The notify the orientation of iOS device changed, using CoreMotion for even taking the orientation in 'Orientation Lock'.
- Xcode
- Swift 4.1
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()