Hi I have a problem with rotation of an Modal presented ViewController in iOS8. All this works fine on iOS7 and lower.
App Struct:
- RootController (supported Orientation: Portrait)
- Modal Presented ViewController (supported Orientation: All)
My Problem is when I Rotate the Device when the Modal Controller is Presented the view of the Modal Controller didn't resize to the lanscape frame.
Looks like so:
The Rotation methods was called and when I set the frame of the view to Landscape manually the user interaction of the right side (screen gray side) didn't 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 any one help me to fix this problem for iOS8.