I am developing a application in iOS. I need to lock or unlock the orientation with a button click.
I have checked this link also.
I need to lock the screen on single click button, if click again means need to unlock.
I have tried using this code but no useful.
- (BOOL)shouldAutorotateToInterfaceOrientation:
(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationPortrait | UIInterfaceOrientationLandscapeLeft | UIInterfaceOrientationLandscapeRight |UIInterfaceOrientationPortraitUpsideDown;
}
Any help is appreciated.