UnityViewControllerBase+iOS.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. @interface UnityViewControllerBase (iOS)
  3. - (BOOL)shouldAutorotate;
  4. - (BOOL)prefersStatusBarHidden;
  5. - (UIStatusBarStyle)preferredStatusBarStyle;
  6. @end
  7. // for better handling of user-imposed screen orientation we will have specific ViewController implementations
  8. // view controllers constrained to one orientation
  9. @interface UnityFixedOrientationViewController : UnityViewControllerBase
  10. - (instancetype)initWithOrientation:(UIInterfaceOrientation)interfaceOrientation;
  11. @end
  12. @interface UnityPortraitOnlyViewController : UnityFixedOrientationViewController
  13. @end
  14. @interface UnityPortraitUpsideDownOnlyViewController : UnityFixedOrientationViewController
  15. @end
  16. @interface UnityLandscapeLeftOnlyViewController : UnityFixedOrientationViewController
  17. @end
  18. @interface UnityLandscapeRightOnlyViewController : UnityFixedOrientationViewController
  19. @end
  20. // this is default view controller implementation (autorotation enabled)
  21. @interface UnityDefaultViewController : UnityViewControllerBase
  22. {
  23. }
  24. // we have well defined points where we should update supported orientations:
  25. // on init and inside [UnityAppController checkOrientationRequest]
  26. // note that the latter will recreate default view controller if supported orientations conflict with the current orientation
  27. // this is done as opposed to [UnityDefaultViewController supportedInterfaceOrientations] poking unity for that
  28. // as this might happen in "random" places, out-of-sync with our handling of "orientation constraints were changed at unity side"
  29. - (void)updateSupportedOrientations;
  30. @end
  31. NSUInteger EnabledAutorotationInterfaceOrientations();