Initial Landscape orientation issue on iOS solved

I have searched for a solution how to implement a ViewController that supports only LandscaleLeft and LandscapeRight mode. Most solutions I found on stackoverflow and other forums using a setOrientationMode selector on the device object:

this could probably work for you, but it uses a non official selector. You may think of this: it is impossible for the program to actually physically turn around your device, but that is what your code would look like.

I finally ended up with a solution that does rotate the interface instead of the device. The following code is a working ViewController that does the trick by calling [UIViewController attemptRotationToDeviceOrientation].

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*