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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…