I have a UINavigationController which I present modally. The modal is correctly presented in the orientation from which the phone is in. However when I dismiss the modal it immediately rotates to portrait and animates to the home button which is either to the left or right when in landscape mode. Navigation whilst the modal is open is all fine, rotating is fine, just not closing.
How can I simply get the modal to close in the orientation the device is in?
I have included an image of the modal being dismissed in landscape mode.
Before:
During:
As you can see the layout is quite broken. The current view presented in the NavigationController does not even resize to the portrait screen dimensions.
It may be worth mentioning that I am presenting a new sotryboard at this point aswell
_storyboard = [UIStoryboard storyboardWithName:storyBoardName bundle:resourceBundle];
_rootViewController = [_storyboard instantiateInitialViewController];
[_sourceViewController presentViewController:_rootViewController animated:animated completion:nil];
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } -(BOOL)shouldAutorotate { return YES; } -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAllButUpsideDown; }
– Brenwell