Search code examples
swiftorientationdefaultlandscape

SpriteKit default landscape orientation


I am making a SpriteKit game that runs in both landscape modes. How can I pick the default landscape orientation?

When I first load the game it loads in landscapeLeft (home button is on left)

Looking at most games on the app store it seems the default orientation is the other way around (landscape right). I also prefer it to be that way.

I have tried playing around with the info.plist but couldnt find anything.

I dont see what i can change in my viewController either because I want to keep both landscape orientations.

 override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
    if UIDevice.currentDevice().userInterfaceIdiom == .Phone {
        return .Landscape
    } else {
        return .Landscape
    }
}

Anyone know what I have to do?

Thanks in advance


Solution

  • Just change the order of items for Supported Interface Orientation key inside info.plist. The app will launch in whatever orientation is specified in the first item. By default, that would be landscape left. Just drag Item 1 (landscape right) in the place of Item 0 (landscape left):

    info.plist