JMD, I have the same question/problem as you, that is, disabling autorotation for a specific screen, but enabling it for all others. As you indicated, supportedInterfaceOrientations( ) in iOS 8 doesn't seem to do anything to solve the problem.
I think that the code below using viewWillTransitionToSize would work IF, like you, I knew how to change the Boolean property for shouldAutorotate; when I attempted to do just that using the code
self.shouldAutorotate( ).boolValue = true
I got the error message "cannot assign to the result of this expression". When I comment that code, I get the results below, so I know that viewWillTransitionToSize is working:
Rotating the Device in the Simulator from Portrait -> LandscapeLeft gives the console message:
will transition size change to (667.0,375.0)
shouldAutorotate Bool = true
height < width: transitioning size change to (667.0,375.0)
Then rotating the Device in the Simulator from LandscapeLeft -> Portrait gives
will transition size change to (375.0,667.0)
shouldAutorotate Bool = true
height > width: transitioning size change to (375.0,667.0)
I know that this doesn't completely answer your question, but maybe someone else can fill in the blanks.
override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
println("will transition size change to \(size)")
var autorotateBoolValue = self.shouldAutorotate()
println("shouldAutorotate Bool = \(autorotateBoolValue)")
if (size.height > size.width) {
coordinator.animateAlongsideTransition({context in
println("height > width: transitioning size change to \(size)")}, completion: {context in
self.shouldAutorotate().boolValue = true
})
}
else {
coordinator.animateAlongsideTransition({context in
println("height < width: transitioning size change to \(size)")}, completion: {context in
self.shouldAutorotate().boolValue = false
})
}
}