I have a universal application being developed in iOS8 (XCode 6.1.1). It will support all the 4 orientations (left, right, portrait & upside down).
The problem i
Well, I have figured out the purpose of the the options on project configuration... Within the options you're saying "my app support these orientations" and not "my app must use these four options"... So, on iPhone you must explicity say that a particular ViewController support all orientations (the upsidedown doesn't make parte of the default orientations, for a reason that I dont know)... The code should be like this for supporting all orientations:
override func supportedInterfaceOrientations() -> Int{
return Int(UIInterfaceOrientationMask.All.rawValue)
}
With Swift 2.1, you can simplify @Cleversou’s answer to:
override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask
{
return .All
}
With Swift 2.3
override var supportedInterfaceOrientations : UIInterfaceOrientationMask {
return .all
}
If you are running inside of a navigation controller or tab bar controller, you will need to do the same override in your subclass or override all instances with an extension:
extension UINavigationController {
override public func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
return .All
}
}
extension UITabBarController {
override public func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
return .All
}
}
Edit: as of Swift 3.0 / iOS 9 (and possibly earlier) this would be:
extension UINavigationController {
override open var supportedInterfaceOrientations : UIInterfaceOrientationMask {
return .all
}
}
extension UITabBarController {
override open var supportedInterfaceOrientations : UIInterfaceOrientationMask {
return .all
}
}