user278859
user278859

Reputation: 10519

iOS 6 orientation changes have me totally confused

This is a universal app and I have the supported interface orientations for both iPhone and iPad targets set only to Landscape Left and Right. My root view controllers do not use a NavigationController and the xibs are landscape oriented views. The app is designed to only use the landscape orientations.

In application:didFinishLaunchingWithOptions I have...

if (([JLHelper isIPhone]) | ([JLHelper iPadPortraitRestricted])) {
         application.statusBarOrientation = UIInterfaceOrientationLandscapeRight;
}

In iOS 5 everything worked fine but In iOS 6 the view does not display in a landscape orientation on startup.

I understand that shouldAutorotateToInterfaceOrientation has been deprecated in iOS 6, but I do not understand why this affects the initial presentation. It appears to me that the root view is being rotated.

I have read many discussions on how to force landscape orientation in iOS 6 and am now totally confused. There must be a simple way to implement an app that only uses landscape orientation.

Upvotes: 0

Views: 781

Answers (1)

Cocoanetics
Cocoanetics

Reputation: 8247

You can specify the supported orientations in the info.plist for iOS 6. Additionally you can implement the shouldAutorotate method and the supportedInterfaceOrientations methods (new as of iOS 6) to conditionally restrict orientations for iOS 6.

Note that if you want to continue to support iOS 5 you also have to have the shouldAutorotateToInterfaceOrientation... method in place. iOS 5 uses the old method, iOS 6 the new one, they can coexist.

Upvotes: 1

Related Questions