0

I'm writing an app in Swift on ios 8 that I want to make sure only works in Portrait mode on all devices (for now). I have "Portrait" selected as the only Device Orientation under "Deployment Info" for the app, as such :

enter image description here

It works fine on simulators and iPhone 6 Plus; however, when testing on an iPad Mini, the orientation changes even though it shouldn't. Is this a known issue or am I missing a configuration somewhere?

Would love any input. TIA.

pikovayadama
  • 808
  • 2
  • 8
  • 26

1 Answers1

1

Try this:

paste these methods in the ViewController of each view:

override func shouldAutorotate() -> Bool {
return false
}

override func supportedInterfaceOrientations() -> Int {
    return UIInterfaceOrientation.Portrait.rawValue
}

And let me know If it works for you.

Dharmesh Kheni
  • 71,228
  • 33
  • 160
  • 165
  • That worked, but caused other problems - similar to the ones listed below; The solutions there helped straighten things out. Thank you. : http://stackoverflow.com/questions/29629106/ios-8-3-supported-orientations-crashs – pikovayadama Jun 30 '15 at 23:35