iOS Development is easy with XCode, Swift3, UITableView, cocatouch, let's build iPhone, iPad and Macbook Applications.

View rotation notifications: why didRotateFromInterfaceOrientation: doesn't get called?

I’m trying to detect any device orientation change so that I can update the views. I want to update the views whether the orientation is portrait or landscape, so I implemented this method: – (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations. return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeRight || interfaceOrientation == UIInterfaceOrientationLandscapeLeft); } […]

UITraitCollection Clarification

I’m trying to figure out how to use UITraitCollection programatically, but I find it difficult to make sense of it. I’m developing for an iPad retina, in iOS 8. println(self.traitCollection) returns the following output: <UITraitCollection: 0x10df4c7f0; _UITraitNameUserInterfaceIdiom = Pad, _UITraitNameDisplayScale = 2.000000, _UITraitNameHorizontalSizeClass = Regular, _UITraitNameVerticalSizeClass = Regular, _UITraitNameTouchLevel = 0, _UITraitNameInteractionModel = 1> Which […]

Dynamically setting fetchLimit for NSFetchedResultsController

I’m using am NSFetchedResultsController to populate data onto a UITableView. It’s a simple chat app and I want to load the latest 25 messages onto the table first and load more as the user scrolls up to see older messages (the chat message are in a ascending order). I call a method that will setFetchLimit: […]

MPMoviePlayerController error _itemFailedToPlayToEnd while playing youtube video iOS 7

I’ve seen this mentioned a few places around the web but have yet to find answer anywhere. I am using ALMovieplayercontroller library. Everything works fine but when i am trying to play Youtube video it gives me error. _itemFailedToPlayToEnd: { kind = 1; new = 2; old = 0; } EDIT – (void)setContentURL:(NSURL *)contentURL { […]

iOS 6 MPMoviePlayerViewController and presentMoviePlayerViewControllerAnimated Rotation

In previous iOS versions, our video would rotate automatically but in iOS 6 this is no longer the case. I know that the presentMoviePlayerViewControllerAnimated was designed to do that before but how can I tell the MPMoviePlayerViewController to rotate automatically? MPMoviePlayerViewController *moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:url]; [self presentMoviePlayerViewControllerAnimated:moviePlayer];

Compress images to reduce file size

I’m building an app that lets the user take a photo or select one from the library on the iPhone and upload it to the Parse backend. The problem I’m facing is regarding to the size of the file. I’ve read about what big players like Facebook, Twitter, Instagram, and Google do regarding resolution and […]

ios – mixing midi files, each with own sound font

I’m looking for a way to mix 2 or more midi files, each with their own sound font files. I’ve found the following code for one file and tried to do multiple music players but i guess that shouldn’t be the right approach. Also i get some weird pop sound every second. So is there […]

How to redirect from Yahoo to my IOS app after authentication?

I am working on an app where I have to use Yahoo account to login. I had gone through this link and followed the procedure as it was there.But I am unable to get back to my app after authentication.After googling I found an answer here.Here he said that “Add an URL Scheme in your […]

Flip transition uinavigationcontroller push

I am pushing a UIViewController in a navigation stack using the following code [UIView animateWithDuration:0.75 animations:^{ [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [self.navigationController pushViewController:ViewController animated:NO]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO]; }]; Now when I press back I want it to do the same animation but its not working. Any idea why? in ViewController.m [UIView animateWithDuration:0.75 animations:^{ [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [self.navigationController popToRootViewControllerAnimated:NO]; […]

Xcode 8 (Swift 3) Command failed due to signal: Killed: 9

After upgrading to Xcode 8 and converting all my code to Swift 3, I have troubles compiling swift resources. It takes a very long time, and my computer gets super laggy and after about 30 minutes I get this CompileSwift normal arm64 /Users/choojayson/Dropbox/BottomsUp/Thirst/UserDrank.swift cd /Users/choojayson/Dropbox/BottomsUp /Applications/ -frontend -c /Users/choojayson/Dropbox/BottomsUp/Thirst/PendingVC.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/NotificationCell.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/ProfileCell.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/NotificationsVC.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/UserPendingAction.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/ChooseDrinkVC.swift /Users/choojayson/Dropbox/BottomsUp/Thirst/AppDelegate.swift […]