https://github.com/rushairer/MotionOrientation
An observer to notify the orientation of iOS device changed, using CoreMotion for taking the orientation in 'Orientation Lock'.
https://github.com/rushairer/MotionOrientation
Last synced: 6 months ago
JSON representation
An observer to notify the orientation of iOS device changed, using CoreMotion for taking the orientation in 'Orientation Lock'.
- Host: GitHub
- URL: https://github.com/rushairer/MotionOrientation
- Owner: rushairer
- License: apache-2.0
- Created: 2020-03-26T05:43:23.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-29T06:27:04.000Z (over 5 years ago)
- Last Synced: 2024-11-12T23:36:22.381Z (about 1 year ago)
- Language: Objective-C
- Size: 37.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-iOS - MotionOrientation - An observer to notify the orientation of iOS device changed, using CoreMotion for taking the orientation in 'Orientation Lock'. (Foundation)
README
MotionOrientation
=================
An observer to notify the orientation of iOS device changed, using CoreMotion for taking the orientation in 'Orientation Lock'.
Requirements
============
This codes are under ARC.
These frameworks are needed.
CoreMotion.framework
CoreGraphics.framework
Usage
=====
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;