I need to detect when the device is in portrait orientation so that I can fire off a special animation. But I do not want my view to autorotate.
How do I override a
First disable all but the orientation you want (so that it doesnt rotate)
Then like David said just get the device current orientation:
https://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/MotionEvents/MotionEvents.html
Alternatively you can just use the accelerometer yourself (since its how it is done anyway) and check where the gravity is at to see what orientation it has. If you take this approach you can play with the values yourself to get different results.