Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yudiz-solutions/motionorientationdemo
The notify the orientation of iOS device changed, using CoreMotion for even taking the orientation in 'Orientation Lock'.
https://github.com/yudiz-solutions/motionorientationdemo
accelerometer coremotion deviceorientation ios motion orientation swift swift4
Last synced: about 1 month ago
JSON representation
The notify the orientation of iOS device changed, using CoreMotion for even taking the orientation in 'Orientation Lock'.
- Host: GitHub
- URL: https://github.com/yudiz-solutions/motionorientationdemo
- Owner: yudiz-solutions
- Created: 2018-08-29T07:30:29.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-31T13:12:46.000Z (about 1 year ago)
- Last Synced: 2023-11-01T13:36:54.820Z (about 1 year ago)
- Topics: accelerometer, coremotion, deviceorientation, ios, motion, orientation, swift, swift4
- Language: Swift
- Size: 13.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MotionOrientation
The notify the orientation of iOS device changed, using CoreMotion for even taking the orientation in 'Orientation Lock'.# Requirements
- Xcode
- Swift 4.1# Usage
Run below line for Start motion manager
```
YZMotionOrientationManager.shared.startAccelerometerUpdates(deviceBlock: { (deviceOrientation) in
// code
}) { (interfacOrientation) in
// code
}
```You will get device orientation and interface orientation using block.
**Run below line for stop motion manager**
```YZMotionOrientationManager.shared.stopAccelerometerUpdates()```