Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. <key>UISupportedInterfaceOrientations</key>
  2. <array>
  3. <string>UIInterfaceOrientationPortrait</string>
  4. <string>UIInterfaceOrientationLandscapeLeft</string>
  5. <string>UIInterfaceOrientationLandscapeRight</string>
  6. </array>
  7.  
  8. //deprecated
  9. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
  10. return (interfaceOrientation == UIInterfaceOrientationPortrait);
  11. }
  12.  
  13. - (NSUInteger)supportedInterfaceOrientations{
  14. return UIInterfaceOrientationMaskPortrait;
  15. }
  16.  
  17. - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
  18.  
  19. @interface MyTabBarController : UITabBarController
  20. {
  21. }
  22. @end
  23.  
  24. @implementation MyTabBarController
  25.  
  26. // put your shouldAutorotateToInterfaceOrientation and other overrides here
  27. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
  28. return (interfaceOrientation == UIInterfaceOrientationPortrait);
  29. }
  30.  
  31. - (NSUInteger)supportedInterfaceOrientations{
  32. return UIInterfaceOrientationMaskPortrait;
  33. }
  34.  
  35. @end
  36.  
  37. - (BOOL)shouldAutorotate;
  38. {
  39. return YES;
  40. }
  41.  
  42. - (NSUInteger)supportedInterfaceOrientations
  43. {
  44. if ([[self topViewController] respondsToSelector:@selector(supportedInterfaceOrientations)])
  45. return [[self topViewController] supportedInterfaceOrientations];
  46. else
  47. return [super supportedInterfaceOrientations];
  48. }
  49.  
  50. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
  51. return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft
  52. || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement