As a developer, I know the list of orientations added in the Project settings/plist for my iOS app, but I would like to know the list of supported orientations from the code.
For eg., one of the 3rd party SDK is returning UIInterfaceOrientationMask.landscapeLeft for one scenario and I would like to validate it in my viewcontroller before allowing the orientation.
And my application is crashing if I don't do it,
Crash -> Supported orientations has no common orientation with the application
You can fetch your supported interface orientations from your info.plist like so:
and then you'll get optional values array (that you can cast to array of Strings if you want to), like so: