TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | Apache 2 |
ReleasedLast Release | Dec 2014 |
Maintained by Ernesto Rivera, Ernesto Rivera.
An observer to notify the orientation of iOS device changed, using CoreMotion for taking the orientation in 'Orientation Lock'.
This codes are under ARC.
These frameworks are needed.
CoreMotion.framework CoreGraphics.framework
Run below.
[MotionOrientation initialize];
Then you can receive notifications below.
MotionOrientationChangedNotification, when the device orientation changed. MotionOrientationInterfaceOrientationChangedNotification, just when the interface orientation changed.
And then you can retrieve orientation informations.
UIInterfaceOrientation interfaceOrientation = [MotionOrientation sharedInstance].interfaceOrientation; UIDeviceOrientation deviceOrientation = [MotionOrientation sharedInstance].deviceOrientation;