Hey. I have a problem with the rotation of the presented ViewController in the iOS8 module. All this works fine on iOS7 and below.
App Struct:
- RootController (orientation supported: portrait)
- Modal Presented by ViewController (supported Orientation: All)
My problem is when I rotate the device when the Modal Controller is displayed, the Modal Controller view has not changed to the lanscape frame size.
Looks like that:
The Rotation methods were called, and when I manually set the view frame to Landscape, the user interaction on the right side (gray side of the screen) did not work.
RootController Code:
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientationPortrait; } - (NSUInteger) supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; }
Modal controller code:
- (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAll; } - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { if (self.presentingViewController != nil) { [self.presentingViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration]; } } - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { if (self.presentingViewController != nil) { [self.presentingViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; } } - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { if (self.presentingViewController != nil) { [self.presentingViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation]; } } - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator { [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) { } completion:^(id<UIViewControllerTransitionCoordinatorContext> context) { }]; }
Can someone help me fix this issue for iOS8.
source share