From 43cb763d799e05371fb490385ec2e74b09027712 Mon Sep 17 00:00:00 2001 From: Aryan Ghassemi Date: Wed, 11 Mar 2015 00:26:38 -0700 Subject: [PATCH 1/2] Fixed interfaceOrientation deprecated warning --- SlideMenu.xcodeproj/project.pbxproj | 2 ++ SlideMenu/SlideMenu-Info.plist | 2 +- .../SlideNavigationContorllerAnimatorSlide.m | 22 +++++++------- SlideMenu/Source/SlideNavigationController.m | 30 ++++++++++--------- 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/SlideMenu.xcodeproj/project.pbxproj b/SlideMenu.xcodeproj/project.pbxproj index 5006a3d..6609ceb 100755 --- a/SlideMenu.xcodeproj/project.pbxproj +++ b/SlideMenu.xcodeproj/project.pbxproj @@ -525,6 +525,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SlideMenu/SlideMenu-Prefix.pch"; INFOPLIST_FILE = "SlideMenu/SlideMenu-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -536,6 +537,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SlideMenu/SlideMenu-Prefix.pch"; INFOPLIST_FILE = "SlideMenu/SlideMenu-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; diff --git a/SlideMenu/SlideMenu-Info.plist b/SlideMenu/SlideMenu-Info.plist index 09b1758..60eac98 100644 --- a/SlideMenu/SlideMenu-Info.plist +++ b/SlideMenu/SlideMenu-Info.plist @@ -9,7 +9,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - com.aryaxt.${PRODUCT_NAME:rfc1034identifier} + com.aryaxt.$(PRODUCT_NAME:rfc1034identifier) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorSlide.m b/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorSlide.m index 9e2c0c3..c694520 100644 --- a/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorSlide.m +++ b/SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorSlide.m @@ -58,7 +58,7 @@ - (void)prepareMenuForAnimation:(Menu)menu ? [SlideNavigationController sharedInstance].leftMenu : [SlideNavigationController sharedInstance].rightMenu; - UIInterfaceOrientation orientation= [SlideNavigationController sharedInstance].interfaceOrientation; + UIDeviceOrientation orientation = [UIDevice currentDevice].orientation; CGRect rect = menuViewController.view.frame; if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) @@ -67,9 +67,9 @@ - (void)prepareMenuForAnimation:(Menu)menu } else { - if (UIInterfaceOrientationIsLandscape(orientation)) + if (UIDeviceOrientationIsLandscape(orientation)) { - if (orientation == UIInterfaceOrientationLandscapeRight) + if (orientation == UIDeviceOrientationLandscapeRight) { rect.origin.y = (menu == MenuLeft) ? self.slideMovement*-1 : self.slideMovement; } @@ -80,7 +80,7 @@ - (void)prepareMenuForAnimation:(Menu)menu } else { - if (orientation == UIInterfaceOrientationPortrait) + if (orientation == UIDeviceOrientationPortrait) { rect.origin.x = (menu == MenuLeft) ? self.slideMovement*-1 : self.slideMovement; } @@ -100,7 +100,7 @@ - (void)animateMenu:(Menu)menu withProgress:(CGFloat)progress ? [SlideNavigationController sharedInstance].leftMenu : [SlideNavigationController sharedInstance].rightMenu; - UIInterfaceOrientation orientation = [SlideNavigationController sharedInstance].interfaceOrientation; + UIDeviceOrientation orientation = [UIDevice currentDevice].orientation; NSInteger location = (menu == MenuLeft) ? (self.slideMovement * -1) + (self.slideMovement * progress) @@ -120,13 +120,13 @@ - (void)animateMenu:(Menu)menu withProgress:(CGFloat)progress } else { - if (UIInterfaceOrientationIsLandscape(orientation)) + if (UIDeviceOrientationIsLandscape(orientation)) { - rect.origin.y = (orientation == UIInterfaceOrientationLandscapeRight) ? location : location*-1; + rect.origin.y = (orientation == UIDeviceOrientationLandscapeRight) ? location : location*-1; } else { - rect.origin.x = (orientation == UIInterfaceOrientationPortrait) ? location : location*-1; + rect.origin.x = (orientation == UIDeviceOrientationPortrait) ? location : location*-1; } } @@ -147,8 +147,8 @@ - (void)clearMenu:(Menu)menu ? [SlideNavigationController sharedInstance].leftMenu : [SlideNavigationController sharedInstance].rightMenu; - UIInterfaceOrientation orientation= [SlideNavigationController sharedInstance].interfaceOrientation; - + UIDeviceOrientation orientation = [UIDevice currentDevice].orientation; + CGRect rect = menuViewController.view.frame; if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) @@ -157,7 +157,7 @@ - (void)clearMenu:(Menu)menu } else { - if (UIInterfaceOrientationIsLandscape(orientation)) + if (UIDeviceOrientationIsLandscape(orientation)) { rect.origin.y = 0; } diff --git a/SlideMenu/Source/SlideNavigationController.m b/SlideMenu/Source/SlideNavigationController.m index 2785286..2efcdba 100644 --- a/SlideMenu/Source/SlideNavigationController.m +++ b/SlideMenu/Source/SlideNavigationController.m @@ -520,7 +520,7 @@ - (void)closeMenuWithDuration:(float)duration andCompletion:(void (^)())completi - (void)moveHorizontallyToLocation:(CGFloat)location { CGRect rect = self.view.frame; - UIInterfaceOrientation orientation = self.interfaceOrientation; + UIDeviceOrientation orientation = [UIDevice currentDevice].orientation; Menu menu = (self.horizontalLocation >= 0 && location >= 0) ? MenuLeft : MenuRight; if ((location > 0 && self.horizontalLocation <= 0) || (location < 0 && self.horizontalLocation >= 0)) { @@ -534,14 +534,14 @@ - (void)moveHorizontallyToLocation:(CGFloat)location } else { - if (UIInterfaceOrientationIsLandscape(orientation)) + if (UIDeviceOrientationIsLandscape(orientation)) { rect.origin.x = 0; - rect.origin.y = (orientation == UIInterfaceOrientationLandscapeRight) ? location : location*-1; + rect.origin.y = (orientation == UIDeviceOrientationLandscapeRight) ? location : location*-1; } else { - rect.origin.x = (orientation == UIInterfaceOrientationPortrait) ? location : location*-1; + rect.origin.x = (orientation == UIDeviceOrientationPortrait) ? location : location*-1; rect.origin.y = 0; } } @@ -570,16 +570,18 @@ - (CGRect)initialRectForMenu return rect; } - if (UIInterfaceOrientationIsLandscape(self.interfaceOrientation)) + UIDeviceOrientation orientation = [UIDevice currentDevice].orientation; + + if (UIDeviceOrientationIsLandscape(orientation)) { // For some reasons in landscape below the status bar is considered y=0, but in portrait it's considered y=20 - rect.origin.x = (self.interfaceOrientation == UIInterfaceOrientationLandscapeRight) ? 0 : STATUS_BAR_HEIGHT; + rect.origin.x = (orientation == UIDeviceOrientationLandscapeRight) ? 0 : STATUS_BAR_HEIGHT; rect.size.width = self.view.frame.size.width-STATUS_BAR_HEIGHT; } else { // For some reasons in landscape below the status bar is considered y=0, but in portrait it's considered y=20 - rect.origin.y = (self.interfaceOrientation == UIInterfaceOrientationPortrait) ? STATUS_BAR_HEIGHT : 0; + rect.origin.y = (orientation == UIDeviceOrientationPortrait) ? STATUS_BAR_HEIGHT : 0; rect.size.height = self.view.frame.size.height-STATUS_BAR_HEIGHT; } @@ -608,7 +610,7 @@ - (void)prepareMenuForReveal:(Menu)menu - (CGFloat)horizontalLocation { CGRect rect = self.view.frame; - UIInterfaceOrientation orientation = self.interfaceOrientation; + UIDeviceOrientation orientation = [UIDevice currentDevice].orientation; if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) { @@ -616,15 +618,15 @@ - (CGFloat)horizontalLocation } else { - if (UIInterfaceOrientationIsLandscape(orientation)) + if (UIDeviceOrientationIsLandscape(orientation)) { - return (orientation == UIInterfaceOrientationLandscapeRight) + return (orientation == UIDeviceOrientationLandscapeRight) ? rect.origin.y : rect.origin.y*-1; } else { - return (orientation == UIInterfaceOrientationPortrait) + return (orientation == UIDeviceOrientationPortrait) ? rect.origin.x : rect.origin.x*-1; } @@ -634,7 +636,7 @@ - (CGFloat)horizontalLocation - (CGFloat)horizontalSize { CGRect rect = self.view.frame; - UIInterfaceOrientation orientation = self.interfaceOrientation; + UIDeviceOrientation orientation = [UIDevice currentDevice].orientation; if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) { @@ -642,7 +644,7 @@ - (CGFloat)horizontalSize } else { - if (UIInterfaceOrientationIsLandscape(orientation)) + if (UIDeviceOrientationIsLandscape(orientation)) { return rect.size.height; } @@ -675,7 +677,7 @@ - (void)navigationController:(UINavigationController *)navigationController - (CGFloat)slideOffset { - return (UIInterfaceOrientationIsLandscape(self.interfaceOrientation)) + return (UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation)) ? self.landscapeSlideOffset : self.portraitSlideOffset; } From 4ce138d4e98437e0f277fc8c4f3c70a563bcfdac Mon Sep 17 00:00:00 2001 From: Aryan Ghassemi Date: Sat, 11 Apr 2015 10:49:22 -0700 Subject: [PATCH 2/2] Update pod spec for version 1.4.6 --- iOS-Slide-Menu.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iOS-Slide-Menu.podspec b/iOS-Slide-Menu.podspec index f2f4c2f..4dae3bc 100644 --- a/iOS-Slide-Menu.podspec +++ b/iOS-Slide-Menu.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'iOS-Slide-Menu' - s.version = '1.4.5' + s.version = '1.4.6' s.summary = 'A Slide Menu for iOS' s.homepage = 'https://github.com/aryaxt/iOS-Slide-Menu' s.license = { @@ -8,7 +8,7 @@ Pod::Spec.new do |s| :file => 'License.txt' } s.author = {'Aryan Ghassemi' => 'https://github.com/aryaxt/iOS-Slide-Menu'} - s.source = {:git => 'https://github.com/aryaxt/iOS-Slide-Menu.git', :tag => '1.4.5'} + s.source = {:git => 'https://github.com/aryaxt/iOS-Slide-Menu.git', :tag => '1.4.6'} s.platform = :ios, '6.0' s.source_files = 'SlideMenu/Source/*.{h,m}', 'SlideMenu/Source/Animations/*.{h,m}' s.resources = ['SlideMenu/Source/Assets/**/*']