I want to lock the device's orientation in a specific ViewController to only portrait but none of the available solutions are working. It is embedded in a UINavigationController.
I deployed it to iOS7 and in the general settings, both landscape and portrait are checked because I want it to rotate for other VCs other than the specific one.
extension UINavigationController { public override func shouldAutorotate() -> Bool { return visibleViewController.shouldAutorotate() } public override func supportedInterfaceOrientations() -> Int { return visibleViewController.supportedInterfaceOrientations() } } this portion of the code is in my ViewController class
override func shouldAutorotate() -> Bool { return false } override func supportedInterfaceOrientations() -> Int { return Int(UIInterfaceOrientation.Portrait.rawValue) }