To use the UISplitViewController, I replace my windowed root controller when navigating from one view controller to another.
To make a nice transition with this, I use the zoom effect as follows:
MyOtherViewController *controller = [[MyOtherViewController alloc] initWithNibName:@"MyOtherView" bundle:nil];
UIWindow *window = ((MyAppDelegate *)[[UIApplication sharedApplication] delegate]).window;
controller.view.frame = [window frame];
controller.view.transform = CGAffineTransformMakeScale(0.01,0.01);
controller.view.alpha = 0;
[window addSubview:controller.view];
[UIView animateWithDuration:0.2 animations:^{
controller.view.transform = CGAffineTransformMakeScale(1,1);
controller.view.alpha = 1.0;
} completion:^(BOOL finished) {
if (finished) {
[self.view removeFromSuperview];
window.rootViewController = controller;
}
}];
and this works very well, except that when performing an animation, the new view is always oriented, as in portrait mode, regardless of the current orientation of the device. When the animation is finished, the view is oriented correctly.
What am I missing?
Things I tried:
- including my new controller view as UIWindow sole
- make my new controller a root view controller before starting the animation.
, , 768x1024 ( ) 748x1024, [0, -1, 1, 0, 0, 0] ( ? ?)