I am trying to present a modal view over my root view controller in a UISplitViewController app. Here is the relevant code.
This works fine when the app is in portrait orientation and the rootViewController is in a popover. And in landscape orientation it will work if the modalViewController has already been presented in portrait orientation. However, if I try to present the modal view controller for the first time in landscape orientation it will not display, and it seems as though the modal view picks up the wrong frame.
Anyone have any ideas?
Code:
modalViewController.navigationController.modalPresentationStyle = UIModalPresentationCurrentContext;
[self.navigationController presentModalViewController:modalViewController.navigationController animated:YES];
This works fine when the app is in portrait orientation and the rootViewController is in a popover. And in landscape orientation it will work if the modalViewController has already been presented in portrait orientation. However, if I try to present the modal view controller for the first time in landscape orientation it will not display, and it seems as though the modal view picks up the wrong frame.
Anyone have any ideas?