1

I am working on an application in which using settings options i want user to choose his own preferred orientation for app be it portait,landscape or both...i want to save his preferred orientation & only allow user preferred orientation there after...if it's possible,how can i achieve this? thanks in advance..

  • Refer the below link to change the orientaion. http://stackoverflow.com/questions/11109662/iphone-set-interfaceorientation-programatically – Neha Gupta Nov 30 '15 at 12:17

1 Answers1

0

Use the below code to change the orientation manually,

[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];

save the orientation in nsuserdefaults like below,

[[NSUserDefaults standardUserDefaults] setValue:@"portrait" forKey:@"orientation"];
Stefan
  • 5,203
  • 8
  • 27
  • 51
satheesh
  • 2,770
  • 2
  • 14
  • 19
  • @ravinder singh this link will help you "http://stackoverflow.com/questions/12615114/how-to-change-the-orientation-of-the-app-without-changing-the-device-orientation" – satheesh Nov 30 '15 at 11:52