Advertisement
Guest User

Untitled

a guest
Jul 7th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. AppDelegate *appDelegate = (AppDelegate *) [UIApplication sharedApplication].delegate;
  2. appDelegate.restrictRotation = TRUE;
  3.  
  4.  
  5. MapViewController * sliderVC = [[MapViewController alloc] init ];
  6.  
  7. sliderVC.modalPresentationStyle = UIModalPresentationCurrentContext;
  8. [self presentViewController:sliderVC animated:NO completion:nil];
  9. sliderVC.view.backgroundColor = [UIColor clearColor];
  10.  
  11. - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
  12. {
  13. if(self.restrictRotation)//set the bool value to view controller which you want to load in landscape
  14. return UIInterfaceOrientationMaskLandscapeRight;
  15. else
  16. return UIInterfaceOrientationMaskPortrait;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement