I have landscape-only app. And navigation works well: when I push a new View, it gets loaded and shown by sliding from left to right. When it gets unloaded, the sliding from right to left. But, when I rotate the device, things change and the pushing is now from right to left. To face a bug in iOS 7 which does not handle old style pushing without avoiding strange lazy appearing of the sliding views, I use this code
- (void)pushViewControllerRetro:(UIViewController *)viewController {
CATransition *transition = [CATransition animation];
transition.duration = 0.3;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromBottom;
[self.view.layer addAnimation:transition forKey:nil];
[self pushViewController:viewController animated:NO];
}
- (void)popViewControllerRetro {
CATransition *transition = [CATransition animation];
transition.duration = 0.3;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromTop;
[self.view.layer addAnimation:transition forKey:nil];
[self popViewControllerAnimated:NO];
}
Why?