Reputation: 17303
I have the following method inside my only ViewController
.
override func willAnimateRotationToInterfaceOrientation(toInterfaceOrientation: UIInterfaceOrientation, duration: NSTimeInterval) {
println("willAnimateRotationToInterfaceOrientation")
super.willAnimateRotationToInterfaceOrientation(toInterfaceOrientation, duration: duration)
switch (toInterfaceOrientation) {
case .Portrait: println(".Portrait")
case .PortraitUpsideDown: println(".PortraitUpsideDown")
case .LandscapeRight: println(".LandscapeRight")
case .LandscapeLeft: println(".LandscapeLeft")
case .Unknown: println(".Unknown")
}
}
And I enabled all possible orientations in the project settings
But even if I rotate 360 in the simulator (same goes for my iPhone), I never get ".PortraitUpsideDown" printed in the console. Why? It almost seems, like Apple doesn't allow this rotation.
Upvotes: 0
Views: 116
Reputation: 10294
You need to specifically return portrait upside down in supportedInterfaceOrientations()
in your base UIViewController
The method implementation should look like so.
override func supportedInterfaceOrientations() -> Int {
return Int(UIInterfaceOrientationMask.All.rawValue)
}
Upvotes: 1