I have an xib file with a .h and .m linked. In the xib there is a UIView with a textView. What I would like to do with that view is open it as a UIPopViewController when you cli
UIPopoverController
works on iPad only. In iOS 8 you can use UIPopoverPresentationController for both iPhone and iPad, and there's a small trick to make it look like UIPopoverController
which is explained HERE.
Here's the Objective-C version of the swift code you see in the link I provided.
@interface SomeViewController : UIViewController
@end
@implementation SomeViewController
-(void) prepareForSegue:(UIStoryboardSegue *) segue sender:(id) sender
{
if ([segue.identifier isEqualToString:@"PopoverSegue"]) {
UIViewController *controller = segue.destinationViewController;
controller.popoverPresentationController.delegate = self;
controller.preferredContentSize = CGSizeMake(320, 186);
}
}
// MARK: UIPopoverPresentationControllerDelegate
-(UIModalPresentationStyle)adaptivePresentationStyleForPresentationController:(UIPresentationController *)controller
{
// Return no adaptive presentation style, use default presentation behaviour
return UIModalPresentationNone;
}
@end