Modal disappearance after rotation of the UISplitViewController

I have a strange problem with UISplitViewController. I have a button in my main view controller that opens a modal view while listening (using a simple storyboard scene).

But the modal look disappears when I rotate the iPad, but only when turning from portrait to landscape. My main view controller is hidden in the portrait, for example, in the native Mail application.

If I am in the landscape (when the wizard is always visible) and open my modal, the rotating device works correctly, and the mod of the mod remains on the screen.

I tried manually running segue programmatically, if I call performSegueWithIdentifier:on splitViewController, the spinner works in both directions. But I was wondering if this was fixed easier, because I have other buttons that display the modals in the main view controller, and I don’t want to do an IB action for each of them and lose the advantages of storyboard scenes.

+5
source share
1 answer

, , ipad , popover , . , , popover presentingViewController, , , splitViewController:willShowViewController popover nil , :

- (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem
{
    // Called when the view is shown again in the split view, invalidating the button and popover controller.
    [self.navigationItem setLeftBarButtonItem:nil animated:YES];
    self.masterPopoverController = nil;
}

, , . , , , performSegueWithIdentifier: splitViewController, , popover.

, , , ... , splitViewController:willHideViewController, viewController, , .

, , , .

, ,

+1

All Articles