From 8e0ac0f115cb5371385d2d58e73f47affa3811c8 Mon Sep 17 00:00:00 2001 From: Jerrold Poh Date: Sat, 3 Aug 2013 16:15:37 +1000 Subject: [PATCH] Updated so when in BrowserController, browser can render in landscape --- Classes/Controllers/NavigationController.m | 15 ++++++++++++++- Info.plist | 8 +++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Classes/Controllers/NavigationController.m b/Classes/Controllers/NavigationController.m index ab7d0781..9a742b03 100644 --- a/Classes/Controllers/NavigationController.m +++ b/Classes/Controllers/NavigationController.m @@ -11,6 +11,7 @@ #import "LoginController.h" #import "UIColor+Orange.h" #import "HackerNewsLoginController.h" +#import "BrowserController.h" @implementation NavigationController @synthesize loginDelegate; @@ -87,6 +88,18 @@ - (void)requestSessions { [loginDelegate navigationControllerRequestedSessions:self]; } -AUTOROTATION_FOR_PAD_ONLY +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { + if ([self.visibleViewController class] == [BrowserController class]) { + return YES; + } + return ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) || (toInterfaceOrientation == UIInterfaceOrientationPortrait); +} + +- (NSUInteger)supportedInterfaceOrientations { + if ([self.visibleViewController class] == [BrowserController class]) { + return UIInterfaceOrientationMaskAll; + } + return ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad ? UIInterfaceOrientationMaskAll : UIInterfaceOrientationMaskPortrait); +} @end diff --git a/Info.plist b/Info.plist index 5de22647..ea4f4381 100644 --- a/Info.plist +++ b/Info.plist @@ -43,7 +43,7 @@ Blue 0 Green - 0.4 + 0.40000000000000002 Red 1 @@ -51,6 +51,12 @@ + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait