In a given event handler (not the “shouldAutorotateToInterfaceOrientation” method) how do I detect the current iPad orientation? I have a text field I have to animate up (when keyboard appears) in the Landscape view, but not in the portrait view and want to know which orientation I’m in to see if the animation is necessary.
In a given event handler (not the shouldAutorotateToInterfaceOrientation method) how do I detect the
Share
Orientation information isn’t very consistent, and there are several approaches. If in a view controller, you can use the
interfaceOrientationproperty. From other places you can call:Alternatively, you can request to receive orientation change notifications:
Some people also like to check the status bar orientation: