How to present popover properly in iOS 8

Okay, A housemate took a look at it and figured it out: func addCategory() { var popoverContent = self.storyboard?.instantiateViewControllerWithIdentifier(“NewCategory”) as UIViewController var nav = UINavigationController(rootViewController: popoverContent) nav.modalPresentationStyle = UIModalPresentationStyle.Popover var popover = nav.popoverPresentationController popoverContent.preferredContentSize = CGSizeMake(500,600) popover.delegate = self popover.sourceView = self.view popover.sourceRect = CGRectMake(100,100,0,0) self.presentViewController(nav, animated: true, completion: nil) } That’s the way. You … Read more

Popover with embedded navigation controller doesn’t respect size on back nav

I was struggling with the same issue. None of the above solutions worked for me pretty nicely, that is why I decided to do a little investigation and find out how this works. This is what I discovered: When you set the contentSizeForViewInPopover in your view controller it won’t be changed by the popover itself … Read more

Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES’

In IOS6 you have supported interface orientations in three places: The .plist (or Target Summary Screen) Your UIApplicationDelegate The UIViewController that is being displayed If you are getting this error it is most likely because the view you are loading in your UIPopover only supports portrait mode. This can be caused by Game Center, iAd, … Read more

UIPopoverPresentationController on iOS 8 iPhone

You can override the default adaptive behaviour (UIModalPresentationFullScreen in compact horizontal environment, i.e. iPhone) using the adaptivePresentationStyleForPresentationController: method available through UIPopoverPresentationController.delegate. UIPresentationController uses this method to ask the new presentation style to use, which in your case, simply returning UIModalPresentationNone will cause the UIPopoverPresentationController to render as a popover instead of fullscreen. Here’s an example … Read more