I have just finished updating and sending an iOS 6.0 version of one of my Apps to the store. This version is backwards compatible with iOS 5.0, thus I kept the shouldAutorotateToInterfaceOrientation:
method and added the new ones as listed below.
I had to do the following:
Autorotation is changing in iOS 6. In iOS 6, the shouldAutorotateToInterfaceOrientation:
method of UIViewController is deprecated. In its place, you should use the supportedInterfaceOrientationsForWindow:
and shouldAutorotate
methods.
Thus, I added these new methods (and kept the old for iOS 5 compatibility):
- (BOOL)shouldAutorotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskAllButUpsideDown;
}
viewWillLayoutSubviews
method and adjust the layout using the view’s bounds rectangle. willRotateToInterfaceOrientation:duration:
,willAnimateRotationToInterfaceOrientation:duration:
, anddidRotateFromInterfaceOrientation:
methods are no longer called on
any view controller that makes a full-screen presentation overpresentViewController:animated:completion:
.[email protected]
and the size is 640×1136. It´s also allowed to supply 640×1096 for the same portrait mode (Statusbar removed). Similar sizes may also be supplied in landscape mode if your app only allows landscape orientation on the iPhone.armv6
code has been dropped. Thus, all devices that I am able to support now (running armv7
) can be upgraded to iOS 5.That was all but just remember to test the autorotation in iOS 5 and iOS 6 because of the changes in rotation.