Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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'.

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()```