MyViewController.mm 1.6 KB

123456789101112131415161718192021222324252627282930313233
  1. /******************************************************************************/
  2. #include "iOS.h"
  3. /******************************************************************************/
  4. Bool DontRemoveThisOrMyViewControllerClassWontBeLinked;
  5. namespace EE
  6. {
  7. MyViewController *ViewController;
  8. }
  9. /******************************************************************************/
  10. @implementation MyViewController
  11. /******************************************************************************/
  12. -(NSUInteger)supportedInterfaceOrientations
  13. {
  14. if(App._closed)return 0; // prevent screen rotation if app called 'Exit'
  15. if(NSArray *supported_orientations=[[[NSBundle mainBundle] infoDictionary] objectForKey:@"UISupportedInterfaceOrientations"])
  16. {
  17. UInt mask=0;
  18. REP([supported_orientations count])
  19. {
  20. Str orient=[supported_orientations objectAtIndex:i];
  21. if( orient=="UIInterfaceOrientationPortrait" )mask|=UIInterfaceOrientationMaskPortrait;else
  22. if( orient=="UIInterfaceOrientationPortraitUpsideDown")mask|=UIInterfaceOrientationMaskPortraitUpsideDown;else
  23. if( orient=="UIInterfaceOrientationLandscapeLeft" )mask|=UIInterfaceOrientationMaskLandscapeLeft;else
  24. if( orient=="UIInterfaceOrientationLandscapeRight" )mask|=UIInterfaceOrientationMaskLandscapeRight;
  25. }
  26. return mask;
  27. }
  28. return UIInterfaceOrientationMaskAll; // if not available then support all orientations
  29. }
  30. -(BOOL)prefersStatusBarHidden {return YES;}
  31. /******************************************************************************/
  32. @end
  33. /******************************************************************************/