@@ -520,7 +520,7 @@ - (void)closeMenuWithDuration:(float)duration andCompletion:(void (^)())completi
520520- (void )moveHorizontallyToLocation : (CGFloat)location
521521{
522522CGRect rect = self.view .frame ;
523- UIDeviceOrientation orientation = [UIDevice currentDevice ]. orientation ;
523+ UIInterfaceOrientation orientation = [UIApplication sharedApplication ]. statusBarOrientation ;
524524Menu 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 (UIDeviceOrientationIsLandscape (orientation))
537+ if (UIInterfaceOrientationIsLandscape (orientation))
538538 {
539539 rect.origin .x = 0 ;
540- rect.origin .y = (orientation == UIDeviceOrientationLandscapeRight ) ? location : location*-1 ;
540+ rect.origin .y = (orientation == UIInterfaceOrientationLandscapeRight ) ? location : location*-1 ;
541541 }
542542 else
543543 {
544- rect.origin .x = (orientation == UIDeviceOrientationPortrait ) ? location : location*-1 ;
544+ rect.origin .x = (orientation == UIInterfaceOrientationPortrait ) ? location : location*-1 ;
545545 rect.origin .y = 0 ;
546546 }
547547 }
@@ -570,18 +570,18 @@ - (CGRect)initialRectForMenu
570570 return rect;
571571 }
572572
573- UIDeviceOrientation orientation = [UIDevice currentDevice ]. orientation ;
573+ UIInterfaceOrientation orientation = [UIApplication sharedApplication ]. statusBarOrientation ;
574574
575- if (UIDeviceOrientationIsLandscape (orientation))
575+ if (UIInterfaceOrientationIsLandscape (orientation))
576576{
577577 // For some reasons in landscape below the status bar is considered y=0, but in portrait it's considered y=20
578- rect.origin .x = (orientation == UIDeviceOrientationLandscapeRight ) ? 0 : STATUS_BAR_HEIGHT;
578+ rect.origin .x = (orientation == UIInterfaceOrientationLandscapeRight ) ? 0 : STATUS_BAR_HEIGHT;
579579 rect.size .width = self.view .frame .size .width -STATUS_BAR_HEIGHT;
580580}
581581else
582582{
583583 // For some reasons in landscape below the status bar is considered y=0, but in portrait it's considered y=20
584- rect.origin .y = (orientation == UIDeviceOrientationPortrait ) ? STATUS_BAR_HEIGHT : 0 ;
584+ rect.origin .y = (orientation == UIInterfaceOrientationPortrait ) ? STATUS_BAR_HEIGHT : 0 ;
585585 rect.size .height = self.view .frame .size .height -STATUS_BAR_HEIGHT;
586586}
587587
@@ -610,23 +610,23 @@ - (void)prepareMenuForReveal:(Menu)menu
610610- (CGFloat)horizontalLocation
611611{
612612CGRect rect = self.view .frame ;
613- UIDeviceOrientation orientation = [UIDevice currentDevice ]. orientation ;
613+ UIInterfaceOrientation orientation = [UIApplication sharedApplication ]. statusBarOrientation ;
614614
615615 if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO (@" 8.0" ))
616616 {
617617 return rect.origin .x ;
618618 }
619619 else
620620 {
621- if (UIDeviceOrientationIsLandscape (orientation))
621+ if (UIInterfaceOrientationIsLandscape (orientation))
622622 {
623- return (orientation == UIDeviceOrientationLandscapeRight )
623+ return (orientation == UIInterfaceOrientationLandscapeRight )
624624 ? rect.origin .y
625625 : rect.origin .y *-1 ;
626626 }
627627 else
628628 {
629- return (orientation == UIDeviceOrientationPortrait )
629+ return (orientation == UIInterfaceOrientationPortrait )
630630 ? rect.origin .x
631631 : rect.origin .x *-1 ;
632632 }
@@ -636,15 +636,15 @@ - (CGFloat)horizontalLocation
636636- (CGFloat)horizontalSize
637637{
638638CGRect rect = self.view .frame ;
639- UIDeviceOrientation orientation = [UIDevice currentDevice ]. orientation ;
639+ UIInterfaceOrientation orientation = [UIApplication sharedApplication ]. statusBarOrientation ;
640640
641641 if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO (@" 8.0" ))
642642 {
643643 return rect.size .width ;
644644 }
645645 else
646646 {
647- if (UIDeviceOrientationIsLandscape (orientation))
647+ if (UIInterfaceOrientationIsLandscape (orientation))
648648 {
649649 return rect.size .height ;
650650 }
@@ -677,7 +677,7 @@ - (void)navigationController:(UINavigationController *)navigationController
677677
678678- (CGFloat)slideOffset
679679{
680- return (UIDeviceOrientationIsLandscape ([UIDevice currentDevice ]. orientation ))
680+ return (UIInterfaceOrientationIsLandscape ([UIApplication sharedApplication ]. statusBarOrientation ))
681681? self.landscapeSlideOffset
682682: self.portraitSlideOffset ;
683683}
0 commit comments