Fixed interfaceOrientation deprecated warning

This commit is contained in:
Aryan Ghassemi 2015-03-11 00:26:38 -07:00
parent 8681050dd0
commit 43cb763d79
4 changed files with 30 additions and 26 deletions

View File

@ -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;
};

View File

@ -9,7 +9,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.aryaxt.${PRODUCT_NAME:rfc1034identifier}</string>
<string>com.aryaxt.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>

View File

@ -58,7 +58,7 @@
? [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 @@
}
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 @@
}
else
{
if (orientation == UIInterfaceOrientationPortrait)
if (orientation == UIDeviceOrientationPortrait)
{
rect.origin.x = (menu == MenuLeft) ? self.slideMovement*-1 : self.slideMovement;
}
@ -100,7 +100,7 @@
? [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 @@
}
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 @@
? [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 @@
}
else
{
if (UIInterfaceOrientationIsLandscape(orientation))
if (UIDeviceOrientationIsLandscape(orientation))
{
rect.origin.y = 0;
}

View File

@ -520,7 +520,7 @@ static SlideNavigationController *singletonInstance;
- (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 @@ static SlideNavigationController *singletonInstance;
}
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 @@ static SlideNavigationController *singletonInstance;
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 @@ static SlideNavigationController *singletonInstance;
- (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 @@ static SlideNavigationController *singletonInstance;
}
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 @@ static SlideNavigationController *singletonInstance;
- (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 @@ static SlideNavigationController *singletonInstance;
}
else
{
if (UIInterfaceOrientationIsLandscape(orientation))
if (UIDeviceOrientationIsLandscape(orientation))
{
return rect.size.height;
}
@ -675,7 +677,7 @@ static SlideNavigationController *singletonInstance;
- (CGFloat)slideOffset
{
return (UIInterfaceOrientationIsLandscape(self.interfaceOrientation))
return (UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation))
? self.landscapeSlideOffset
: self.portraitSlideOffset;
}