From af435390154166253f64dec89d2b59a980592804 Mon Sep 17 00:00:00 2001 From: Diego Waxemberg Date: Mon, 20 Oct 2014 21:39:40 -0400 Subject: [PATCH] fix orientation issues --- Limelight/Limelight-Info.plist | 2 ++ Limelight/MainFrameViewController.m | 22 ++++++++++++++++++++++ Limelight/StreamFrameViewController.m | 12 ++++++++++++ MainFrame-iPhone.storyboard | 6 +++--- 4 files changed, 39 insertions(+), 3 deletions(-) diff --git a/Limelight/Limelight-Info.plist b/Limelight/Limelight-Info.plist index ff9d66f..0fa11f2 100644 --- a/Limelight/Limelight-Info.plist +++ b/Limelight/Limelight-Info.plist @@ -34,6 +34,8 @@ UIStatusBarHidden + UIStatusBarHidden~ipad + UISupportedInterfaceOrientations UIInterfaceOrientationLandscapeLeft diff --git a/Limelight/MainFrameViewController.m b/Limelight/MainFrameViewController.m index 7ad189c..2d25685 100644 --- a/Limelight/MainFrameViewController.m +++ b/Limelight/MainFrameViewController.m @@ -173,4 +173,26 @@ static StreamConfiguration* streamConfig; [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } + +- (BOOL)shouldAutorotate { + return YES; +} + +- (NSUInteger)supportedInterfaceOrientations { + NSString *deviceType = [UIDevice currentDevice].model; + if ([deviceType containsString:@"iPhone"] || [deviceType containsString:@"iPod"]) { + return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown; + } else { + return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight; + } +} + +- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { + NSString *deviceType = [UIDevice currentDevice].model; + if ([deviceType containsString:@"iPhone"] || [deviceType containsString:@"iPod"]) { + return UIInterfaceOrientationPortrait; + } else { + return UIInterfaceOrientationLandscapeLeft; + } +} @end diff --git a/Limelight/StreamFrameViewController.m b/Limelight/StreamFrameViewController.m index 4bf4b5b..8514e3f 100644 --- a/Limelight/StreamFrameViewController.m +++ b/Limelight/StreamFrameViewController.m @@ -40,4 +40,16 @@ // Dispose of any resources that can be recreated. } +- (BOOL)shouldAutorotate { + return YES; +} + +- (NSUInteger)supportedInterfaceOrientations { + return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight; +} + +- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { + return UIInterfaceOrientationLandscapeLeft; +} + @end diff --git a/MainFrame-iPhone.storyboard b/MainFrame-iPhone.storyboard index ebb9dc2..f21e6c6 100644 --- a/MainFrame-iPhone.storyboard +++ b/MainFrame-iPhone.storyboard @@ -50,7 +50,7 @@ - + @@ -65,8 +65,8 @@ - - + +