If I want to display some data from the environment in my view controller (for instance, what the camera sees), how can I determine what the rotation of the view controller is relative to device so that I display the content in the proper orientation?
This may seem like a simple question, but Apple has deprecated the use of interfaceOrientation in view controllers (and, indeed that only worked for full screen view controllers). Device orientation does not guarantee the rotation of the view controller (aka != interfaceOrientation). As far as I can tell this is now impossible when supporting multiple orientations, perhaps I am missing something.
Indeed, this may not be the view controller's role at all, but I think it makes sense for the view to be able to arrive at this. This could even work through a third party, for instance, let xform: CGAffineTransform = UIDevice.currentDevice().transformToDeviceSpaceForLayer(myLayer).
One big problem here is iPad, which can actually start your app in various orientations. What would be the proper way to determine what orientation to present the camera's view on startup there?
Thoughts?