Search code examples
objective-cioslockinguiinterfaceorientation

(globally) lock Interface Orientation?


Is there a way to lock the interface orientation in my app other than the usual shouldRotate... method? I'm looking for a way to lock the current orientation similar to the lock-button of ios, which will override all app settings and lock the orientation. Is there possibly a way to even set the iOS orientation log progamatically? If not, should it be sufficient to implement shouldAutorotateToInterfaceOrientation in one visible view to block rotation for the whole app?


Solution

  • You can specify which orientations are supported by your app in the info.plist, using the key:

     UISupportedInterfaceOrientations