@@ -520,7 +520,7 @@ - (void)closeMenuWithDuration:(float)duration andCompletion:(void (^)())completi
520520- (void )moveHorizontallyToLocation : (CGFloat)location
521521{
522522CGRect rect = self.view .frame ;
523- UIInterfaceOrientation orientation = self. interfaceOrientation ;
523+ UIDeviceOrientation orientation = [UIDevice currentDevice ]. orientation ;
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 (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}
579581else
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{
610612CGRect 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{
636638CGRect 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}
0 commit comments