So i've run into a fun little bug. I have a UINavigationController with several subviews that it will display that we only want to be viewable in Portrait View. To achieve this we subclassed the UINavigationController and added the following:
override func shouldAutorotate() -> Bool {
return false
}
override func supportedInterfaceOrientations() -> Int {
return Int(UIInterfaceOrientationMask.Portrait.rawValue)
}
This works great, and the app is locked into Portrait and cannot rotate EXCEPT if the user turns the device sideways and then loads the app from landscape. The expected outcome was for the device to load in portrait, however it loads in landscape, and won't let the user rotate back to portrait ever.
The only way I've been able to replicate this is by loading the app from a device already in landscape mode. Any ideas? There are lots of posts about device orientation, but none I could find talking about on app boot.