Skip to content

Commit 363306a

Browse files
committed
Merge pull request #127 from aryaxt/FixInterfaceOrientationWarning
Fixed interfaceOrientation deprecated warning
2 parents 8681050 + 4ce138d commit 363306a

File tree

5 files changed

+32
-28
lines changed

5 files changed

+32
-28
lines changed

SlideMenu.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@
525525
GCC_PRECOMPILE_PREFIX_HEADER = YES;
526526
GCC_PREFIX_HEADER = "SlideMenu/SlideMenu-Prefix.pch";
527527
INFOPLIST_FILE = "SlideMenu/SlideMenu-Info.plist";
528+
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
528529
PRODUCT_NAME = "$(TARGET_NAME)";
529530
WRAPPER_EXTENSION = app;
530531
};
@@ -536,6 +537,7 @@
536537
GCC_PRECOMPILE_PREFIX_HEADER = YES;
537538
GCC_PREFIX_HEADER = "SlideMenu/SlideMenu-Prefix.pch";
538539
INFOPLIST_FILE = "SlideMenu/SlideMenu-Info.plist";
540+
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
539541
PRODUCT_NAME = "$(TARGET_NAME)";
540542
WRAPPER_EXTENSION = app;
541543
};

SlideMenu/SlideMenu-Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<key>CFBundleExecutable</key>
1010
<string>${EXECUTABLE_NAME}</string>
1111
<key>CFBundleIdentifier</key>
12-
<string>com.aryaxt.${PRODUCT_NAME:rfc1034identifier}</string>
12+
<string>com.aryaxt.$(PRODUCT_NAME:rfc1034identifier)</string>
1313
<key>CFBundleInfoDictionaryVersion</key>
1414
<string>6.0</string>
1515
<key>CFBundleName</key>

SlideMenu/Source/Animations/SlideNavigationContorllerAnimatorSlide.m

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ - (void)prepareMenuForAnimation:(Menu)menu
5858
? [SlideNavigationController sharedInstance].leftMenu
5959
: [SlideNavigationController sharedInstance].rightMenu;
6060

61-
UIInterfaceOrientation orientation= [SlideNavigationController sharedInstance].interfaceOrientation;
61+
UIDeviceOrientation orientation = [UIDevice currentDevice].orientation;
6262
CGRect rect = menuViewController.view.frame;
6363

6464
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0"))
@@ -67,9 +67,9 @@ - (void)prepareMenuForAnimation:(Menu)menu
6767
}
6868
else
6969
{
70-
if (UIInterfaceOrientationIsLandscape(orientation))
70+
if (UIDeviceOrientationIsLandscape(orientation))
7171
{
72-
if (orientation == UIInterfaceOrientationLandscapeRight)
72+
if (orientation == UIDeviceOrientationLandscapeRight)
7373
{
7474
rect.origin.y = (menu == MenuLeft) ? self.slideMovement*-1 : self.slideMovement;
7575
}
@@ -80,7 +80,7 @@ - (void)prepareMenuForAnimation:(Menu)menu
8080
}
8181
else
8282
{
83-
if (orientation == UIInterfaceOrientationPortrait)
83+
if (orientation == UIDeviceOrientationPortrait)
8484
{
8585
rect.origin.x = (menu == MenuLeft) ? self.slideMovement*-1 : self.slideMovement;
8686
}
@@ -100,7 +100,7 @@ - (void)animateMenu:(Menu)menu withProgress:(CGFloat)progress
100100
? [SlideNavigationController sharedInstance].leftMenu
101101
: [SlideNavigationController sharedInstance].rightMenu;
102102

103-
UIInterfaceOrientation orientation = [SlideNavigationController sharedInstance].interfaceOrientation;
103+
UIDeviceOrientation orientation = [UIDevice currentDevice].orientation;
104104

105105
NSInteger location = (menu == MenuLeft)
106106
? (self.slideMovement * -1) + (self.slideMovement * progress)
@@ -120,13 +120,13 @@ - (void)animateMenu:(Menu)menu withProgress:(CGFloat)progress
120120
}
121121
else
122122
{
123-
if (UIInterfaceOrientationIsLandscape(orientation))
123+
if (UIDeviceOrientationIsLandscape(orientation))
124124
{
125-
rect.origin.y = (orientation == UIInterfaceOrientationLandscapeRight) ? location : location*-1;
125+
rect.origin.y = (orientation == UIDeviceOrientationLandscapeRight) ? location : location*-1;
126126
}
127127
else
128128
{
129-
rect.origin.x = (orientation == UIInterfaceOrientationPortrait) ? location : location*-1;
129+
rect.origin.x = (orientation == UIDeviceOrientationPortrait) ? location : location*-1;
130130
}
131131
}
132132

@@ -147,8 +147,8 @@ - (void)clearMenu:(Menu)menu
147147
? [SlideNavigationController sharedInstance].leftMenu
148148
: [SlideNavigationController sharedInstance].rightMenu;
149149

150-
UIInterfaceOrientation orientation= [SlideNavigationController sharedInstance].interfaceOrientation;
151-
150+
UIDeviceOrientation orientation = [UIDevice currentDevice].orientation;
151+
152152
CGRect rect = menuViewController.view.frame;
153153

154154
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0"))
@@ -157,7 +157,7 @@ - (void)clearMenu:(Menu)menu
157157
}
158158
else
159159
{
160-
if (UIInterfaceOrientationIsLandscape(orientation))
160+
if (UIDeviceOrientationIsLandscape(orientation))
161161
{
162162
rect.origin.y = 0;
163163
}

SlideMenu/Source/SlideNavigationController.m

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ - (void)closeMenuWithDuration:(float)duration andCompletion:(void (^)())completi
520520
- (void)moveHorizontallyToLocation:(CGFloat)location
521521
{
522522
CGRect rect = self.view.frame;
523-
UIInterfaceOrientation orientation = self.interfaceOrientation;
523+
UIDeviceOrientation orientation = [UIDevice currentDevice].orientation;
524524
Menu menu = (self.horizontalLocation >= 0 && location >= 0) ? MenuLeft : MenuRight;
525525

526526
if ((location > 0 && self.horizontalLocation <= 0) || (location < 0 && self.horizontalLocation >= 0)) {
@@ -534,14 +534,14 @@ - (void)moveHorizontallyToLocation:(CGFloat)location
534534
}
535535
else
536536
{
537-
if (UIInterfaceOrientationIsLandscape(orientation))
537+
if (UIDeviceOrientationIsLandscape(orientation))
538538
{
539539
rect.origin.x = 0;
540-
rect.origin.y = (orientation == UIInterfaceOrientationLandscapeRight) ? location : location*-1;
540+
rect.origin.y = (orientation == UIDeviceOrientationLandscapeRight) ? location : location*-1;
541541
}
542542
else
543543
{
544-
rect.origin.x = (orientation == UIInterfaceOrientationPortrait) ? location : location*-1;
544+
rect.origin.x = (orientation == UIDeviceOrientationPortrait) ? location : location*-1;
545545
rect.origin.y = 0;
546546
}
547547
}
@@ -570,16 +570,18 @@ - (CGRect)initialRectForMenu
570570
return rect;
571571
}
572572

573-
if (UIInterfaceOrientationIsLandscape(self.interfaceOrientation))
573+
UIDeviceOrientation orientation = [UIDevice currentDevice].orientation;
574+
575+
if (UIDeviceOrientationIsLandscape(orientation))
574576
{
575577
// For some reasons in landscape below the status bar is considered y=0, but in portrait it's considered y=20
576-
rect.origin.x = (self.interfaceOrientation == UIInterfaceOrientationLandscapeRight) ? 0 : STATUS_BAR_HEIGHT;
578+
rect.origin.x = (orientation == UIDeviceOrientationLandscapeRight) ? 0 : STATUS_BAR_HEIGHT;
577579
rect.size.width = self.view.frame.size.width-STATUS_BAR_HEIGHT;
578580
}
579581
else
580582
{
581583
// For some reasons in landscape below the status bar is considered y=0, but in portrait it's considered y=20
582-
rect.origin.y = (self.interfaceOrientation == UIInterfaceOrientationPortrait) ? STATUS_BAR_HEIGHT : 0;
584+
rect.origin.y = (orientation == UIDeviceOrientationPortrait) ? STATUS_BAR_HEIGHT : 0;
583585
rect.size.height = self.view.frame.size.height-STATUS_BAR_HEIGHT;
584586
}
585587

@@ -608,23 +610,23 @@ - (void)prepareMenuForReveal:(Menu)menu
608610
- (CGFloat)horizontalLocation
609611
{
610612
CGRect rect = self.view.frame;
611-
UIInterfaceOrientation orientation = self.interfaceOrientation;
613+
UIDeviceOrientation orientation = [UIDevice currentDevice].orientation;
612614

613615
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0"))
614616
{
615617
return rect.origin.x;
616618
}
617619
else
618620
{
619-
if (UIInterfaceOrientationIsLandscape(orientation))
621+
if (UIDeviceOrientationIsLandscape(orientation))
620622
{
621-
return (orientation == UIInterfaceOrientationLandscapeRight)
623+
return (orientation == UIDeviceOrientationLandscapeRight)
622624
? rect.origin.y
623625
: rect.origin.y*-1;
624626
}
625627
else
626628
{
627-
return (orientation == UIInterfaceOrientationPortrait)
629+
return (orientation == UIDeviceOrientationPortrait)
628630
? rect.origin.x
629631
: rect.origin.x*-1;
630632
}
@@ -634,15 +636,15 @@ - (CGFloat)horizontalLocation
634636
- (CGFloat)horizontalSize
635637
{
636638
CGRect rect = self.view.frame;
637-
UIInterfaceOrientation orientation = self.interfaceOrientation;
639+
UIDeviceOrientation orientation = [UIDevice currentDevice].orientation;
638640

639641
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0"))
640642
{
641643
return rect.size.width;
642644
}
643645
else
644646
{
645-
if (UIInterfaceOrientationIsLandscape(orientation))
647+
if (UIDeviceOrientationIsLandscape(orientation))
646648
{
647649
return rect.size.height;
648650
}
@@ -675,7 +677,7 @@ - (void)navigationController:(UINavigationController *)navigationController
675677

676678
- (CGFloat)slideOffset
677679
{
678-
return (UIInterfaceOrientationIsLandscape(self.interfaceOrientation))
680+
return (UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation))
679681
? self.landscapeSlideOffset
680682
: self.portraitSlideOffset;
681683
}

iOS-Slide-Menu.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Pod::Spec.new do |s|
22
s.name = 'iOS-Slide-Menu'
3-
s.version = '1.4.5'
3+
s.version = '1.4.6'
44
s.summary = 'A Slide Menu for iOS'
55
s.homepage = 'https://github.com/aryaxt/iOS-Slide-Menu'
66
s.license = {
77
:type => 'MIT',
88
:file => 'License.txt'
99
}
1010
s.author = {'Aryan Ghassemi' => 'https://github.com/aryaxt/iOS-Slide-Menu'}
11-
s.source = {:git => 'https://github.com/aryaxt/iOS-Slide-Menu.git', :tag => '1.4.5'}
11+
s.source = {:git => 'https://github.com/aryaxt/iOS-Slide-Menu.git', :tag => '1.4.6'}
1212
s.platform = :ios, '6.0'
1313
s.source_files = 'SlideMenu/Source/*.{h,m}', 'SlideMenu/Source/Animations/*.{h,m}'
1414
s.resources = ['SlideMenu/Source/Assets/**/*']

0 commit comments

Comments
 (0)