I would like to be able to get the orientation of my iOS
application's view
using UIInterfaceOrientation
.
This is different to UIDevice.current.orientation
as that returns how the device should rotate rather than its actual rotation and has the possibility of returning unknown
.
I have noticed UIInterfaceOrientation.portrait
, UIInterfaceOrientation.portraitUpsideDown
, UIInterfaceOrientation.landscapeLeft
and UIInterfaceOrientation.landscapeRight
but I am not sure how to detect these.
I will need this so that my User Interface
can update correctly, when UIDevice.current.orientation
returns an unknown
or an incorrect orientation it ruins the UI.