What is the best way to detect a device's orientation in an application extension? I have had mixed results with solutions I've found on here:
How to detect Orientation Change in Custom Keyboard Extension in iOS 8?
Get device current orientation (App Extension)
I have looked at size classes and UITraitCollection
and found that the device inaccurately reports that it is in portrait when it is in fact in landscape (not sure if this is OS bug, or I am not querying the right APIs the right way).
What is the best method for accomplishing:
- The device's current orientation when the extension is first loaded
- The orientation the device will rotate to
- The orientation the device did rotate to
Thank you,