I locked the app orientation to portrait from the general app setting like this
but still when i run my application on ipad, it rotates!?
so where should i lock the orientation ?
why apple added this feature to settings, while it is not working !?
UPDATE:
I tried to implement this viewController as the general for all the viewController as well.
import Foundation import UIKit class GeneralViewController: UIViewController { override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) let value = UIInterfaceOrientation.Portrait.rawValue UIDevice.currentDevice().setValue(value, forKey: "orientation") } override func supportedInterfaceOrientations() -> Int { return Int(UIInterfaceOrientationMask.Portrait.rawValue) } override func preferredInterfaceOrientationForPresentation() -> UIInterfaceOrientation { return UIInterfaceOrientation.Portrait } override func shouldAutorotate() -> Bool { return false } }
this pic taken from the main navigationController of my app.
still did not work!
how on earth this thing works?
You don't need extra code, I'm working on Xcode 7.0.1, I noticed that when I lock screen orientation to only portrait, it locks only in iPhones, to lock it in iPads also, you need to select iPad from Devices (instead of Universal) and check portrait and uncheck the others and then return Devices to Universal again, as I found that Universal only reflect in iPhones, it maybe some kind of bug in Xcode.
I also had same problem. What worked for me was -> Select iPad instead of Universal in Device Type -> Uncheck the other three options except Portrait -> Select Universal again. Done.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With