iOSDeviceRotation
detect-device-rotation-even-when-rotation-lock-is-on
original link
http://www.prettyitgirl.com/2015/11/detect-device-rotation-even-when-rotation-lock-is-on.html
I just converted objc to swift. But there are some force unwrappings. Be careful of it, if you want to use in your product(not test) project,