iPad Device OrientationIn order to properly display/render you view, knowing the orientation of iPad is must. There are couple of ways to do so using the UIDevice API, Notification Center and Status Bar Orientation check. Choose the one the works for your situation.


Get the handle to the current device and hence the orientation. [[UIDevice currentDevice] orientation]

Register for Orientation Change

Using the NSNotification Center add an observer to receive notification changes. [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:UIDeviceOrientationDidChangeNotification object:nil];

 Check Status Bar Orientation

In this approach check the orientation of the status bar [UIApplication sharedApplication].statusBarOrientation