It seems to me this does not work anymore in iOS9. It was the de facto way of forcing orientation changes based my SO research. It now freezes my SpriteKit game.
Is it just me, and if not does anyone know of an alternative?
EDIT: Portrait and UpsideDown still work. It seems only Landscape modes now cause a freeze
EDIT 2: Actually I think you can go Portrait <--> UpsideDown and LandscapeLeft <--> LandscapeRight, but not in between them
Adding to Alex's answer: My experience is that Apple only blocks the orientation change for iOS9 iPads that don't require fullscreen. So if you tell the app to require fullscreen, the rotation should work:
However, I have no clue whether it'll solve your SpriteKit freeze since in my experience iOS9 also introduced plenty of SpriteKit bugs.
You are right. Setting the device orientation is not possible on iOS 9. I think this is because of the new SplitScreen Mode on iPad. Now there can be 2 Applications at once on screen and it would be "unfair" for the one Application to decide which orientation is allowed. Imagine two Apps which force different orientations, what would happen? I think Apple just prohibits it in general even though they could limit to iPad non-fullscreen Applications
If you have two or more ViewControllers,and you want each of the ViewControllers has different orientation, I think the best way to force the orientation of the VC is to use these code below:
It works for me at iOS 9.