FullScreenViewController.m 997 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* Copyright (C) 2012 IGN Entertainment, Inc. */
  2. #import "FullScreenViewController.h"
  3. #import "FullScreenView.h"
  4. @interface FullScreenViewController ()
  5. @property (nonatomic, strong) FullScreenView *fullScreenView;
  6. @end
  7. @implementation FullScreenViewController
  8. - (id)init
  9. {
  10. if (self = [super init]) {
  11. self.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
  12. }
  13. return self;
  14. }
  15. - (void)loadView
  16. {
  17. self.fullScreenView = [[FullScreenView alloc] init];
  18. [self setView:self.fullScreenView];
  19. }
  20. - (NSUInteger)supportedInterfaceOrientations
  21. {
  22. if (!self.allowPortraitFullscreen) {
  23. return UIInterfaceOrientationMaskLandscape;
  24. } else {
  25. return UIInterfaceOrientationMaskAll;
  26. }
  27. }
  28. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
  29. {
  30. if (!self.allowPortraitFullscreen) {
  31. return UIInterfaceOrientationIsLandscape(toInterfaceOrientation);
  32. } else {
  33. return YES;
  34. }
  35. }
  36. @end