locking orientation does not work on ipad ios 8 swift xcode 6.2
You don't need extra code, I'm working on Xcode 7.0.1, I noticed that when I lock screen orientation to only portrait, it locks only in iPhones, to lock it in iPads also, you need to select iPad from Devices (instead of Universal) and check portrait and uncheck the others and then return Devices to Universal again, as I found that Universal only reflect in iPhones, it maybe some kind of bug in Xcode.
I also had same problem. What worked for me was -> Select iPad instead of Universal in Device Type -> Uncheck the other three options except Portrait -> Select Universal again. Done.