I am working on a universal iPhone / iPad application with a universal storyboard. For some ViewControllers, I use size classes if they have a specific layout on the iPad.
I have one ViewController that should be presented modally on the iPhone, but on the iPad it should appear in the UIPopoverController.
UINavigationController *navigationController = [self.storyboard instantiateViewControllerWithIdentifier:@"ComposeMessageNavigationController"]; ComposeMessageViewController *viewController = (ComposeMessageViewController *)navigationController.topViewController; //Prepeare my view controlller ... if (IS_IPAD) { UIPopoverController * popover = [[UIPopoverController alloc] initWithContentViewController:navigationController]; CGSize screenSize = [UIScreen mainScreen].bounds.size; CGRect popoverFrame = CGRectMake(screenSize.width / 2, screenSize.height / 2, 1, 1); [popover presentPopoverFromRect:popoverFrame inView:self.view permittedArrowDirections:0 animated:YES]; } else { [self presentViewController:navigationController animated:YES completion:^{ }]; }
It works very well, but the problem is with class classes. I made some changes to the storyboard in the wRegular / hRegular Size class, but the iPhone layout is still displayed on the iPad in the UIPopoverController. This is due to the size of the popover lower than the iPad screen. Can I make changes to Interface Builder with size classes to show them in popover on iPad, but ignore them on iPhone?
source share