Amit Kalra
Amit Kalra

Reputation: 4113

How can I disable landscape orientation universally?

I'm trying to disable landscape mode for my app and I turned off the settings here

enter image description here

This turns off landscape for the iPhone but not for the iPad, so I went into the info.plist and tried removing the last two but when I submitted the build to iTunes Connect it said they need to be there... So I don't know if there's a way to disable horizontal mode for the iPad? I want portrait mode to be the only thing on iPhone and iPad.

enter image description here

This is the error I get.

enter image description here

Thanks! Hope someone can help!

Upvotes: 0

Views: 686

Answers (2)

KKRocks
KKRocks

Reputation: 8322

You can do this using programming using this :

First you need to enable orientations in General setting tab.

And Remove all key from plist.

 func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
          return UIInterfaceOrientationMask(rawValue: IInterfaceOrientationMask.portrait) // this enable all portrait orientation for all device
}

Upvotes: 0

Tj3n
Tj3n

Reputation: 9943

Try check Requires full screen, i think it will opt your app out of multitasking and wont prompt error anymore when compile

Upvotes: 2

Related Questions