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

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