问题
Is there a way to programmatically check if the iPods orientation lock is enabled before a rotation happens?
For example, if a user was to click a button could we check if the orientation lock was on to alert them that it must be off before an action happens on the click.
回答1:
As for now there's no way to detect if orientation is locked or not. You could just add what orientation you should support in your application and what the default orientation should be, but you can´t get the status for the "Portrait lock" in the device.
来源:https://stackoverflow.com/questions/34936205/how-to-programatically-check-if-orientation-is-locked-on-ios-swift