I am currently working on a SpriteKit game for iOS 7+ and Xcode 6. The game should always be presented in portrait mode. So far, I have implemented these methods in my controller:
- (BOOL)shouldAutorotate {
return NO;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
This works great while I launch an app that supports my iPad in portrait mode. It does not switch orientation during the game.
But when you launch the iPad in landscape orientation during application launch, the game is displayed in landscape orientation.
How to make the application appear in portrait mode, even if the device was saved in landscape mode during startup?
source
share