Would like everything on the screen (UI) to be able to rotate from landscape left to right or vica versa.
How do I go about doing this? Is this private?
I know that
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {}
lets you say which orientations the UI can be, but is there a way to force only one at a time?
Cheers
As suggested on a related thread
shouldAutorotateToInterfaceOrientation
is deprecated. Newer apps should leverage the following methods as described in Apple's UIViewController Class Reference until they themselves become deprecated:shouldAutorotate
,preferredInterfaceOrientationForPresentation
; andattemptRotationToDeviceOrientation
.From what I understand it's best to use different View Controllers for views which need to lock into (i.e. have a preferred) orientation mode which differs from the last.
Also this simple way works:
and back:
Even though this is not an idle solution, works well for me.
This was addressed by: Guntis Treulands https://stackoverflow.com/a/10146270/894671