From b4ff040287265aa207e62e5baa8b904cfbac7ca4 Mon Sep 17 00:00:00 2001 From: oseparovic Date: Wed, 27 Mar 2013 11:34:47 -0700 Subject: [PATCH] Update TSAlertView.m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added in iOS6 autorotation methods to make it easier for users to disable autorotation if desired. Simply setting shouldAutorotateToInterfaceOrientation to return NO will no longer prevent autorotation. Tested on 6.1.3  --- TSAlertView/TSAlertView.m | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/TSAlertView/TSAlertView.m b/TSAlertView/TSAlertView.m index e83fe74..9c71167 100644 --- a/TSAlertView/TSAlertView.m +++ b/TSAlertView/TSAlertView.m @@ -86,10 +86,19 @@ @interface TSAlertViewController : UIViewController @end @implementation TSAlertViewController -- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation -{ - return YES; +- (BOOL)shouldAutorotate { + return YES; +} + +- (NSUInteger)supportedInterfaceOrientations { + return UIInterfaceOrientationMaskAll; } + +// pre-iOS6 support +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { + return YES; +} + - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration { TSAlertView* av = [self.view.subviews lastObject];