I’m pretty new to iOS development so please bear with me.
I am creating an app that I want to strictly be used in landscape mode.
I have edited the .plist file to include these two keys:
Initial interface orientation: Landscape (right home button) &
Supported interface orientation: Landscape (right home button)
And I’ve added the following code to ViewController.m:
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
The app currently starts as it’s supposed to in the simulator. It starts up in landscape mode and everything works just fine. However, my problem comes in when press a button that takes me to another “scene”. The landscape mode doesn’t carry throughout the rest of the apps.
So my question is, how do I force landscape mode throughout my entire app?
You want to have
shouldAutorotateToInterfaceOrientation:in each ViewController.