@@ -520,7 +520,7 @@ - (void)closeMenuWithDuration:(float)duration andCompletion:(void (^)())completi
520
520
- (void )moveHorizontallyToLocation : (CGFloat)location
521
521
{
522
522
CGRect rect = self.view .frame ;
523
- UIInterfaceOrientation orientation = self. interfaceOrientation ;
523
+ UIDeviceOrientation orientation = [UIDevice currentDevice ]. orientation ;
524
524
Menu menu = (self.horizontalLocation >= 0 && location >= 0 ) ? MenuLeft : MenuRight;
525
525
526
526
if ((location > 0 && self.horizontalLocation <= 0 ) || (location < 0 && self.horizontalLocation >= 0 )) {
@@ -534,14 +534,14 @@ - (void)moveHorizontallyToLocation:(CGFloat)location
534
534
}
535
535
else
536
536
{
537
- if (UIInterfaceOrientationIsLandscape (orientation))
537
+ if (UIDeviceOrientationIsLandscape (orientation))
538
538
{
539
539
rect.origin .x = 0 ;
540
- rect.origin .y = (orientation == UIInterfaceOrientationLandscapeRight ) ? location : location*-1 ;
540
+ rect.origin .y = (orientation == UIDeviceOrientationLandscapeRight ) ? location : location*-1 ;
541
541
}
542
542
else
543
543
{
544
- rect.origin .x = (orientation == UIInterfaceOrientationPortrait ) ? location : location*-1 ;
544
+ rect.origin .x = (orientation == UIDeviceOrientationPortrait ) ? location : location*-1 ;
545
545
rect.origin .y = 0 ;
546
546
}
547
547
}
@@ -570,16 +570,18 @@ - (CGRect)initialRectForMenu
570
570
return rect;
571
571
}
572
572
573
- if (UIInterfaceOrientationIsLandscape (self.interfaceOrientation ))
573
+ UIDeviceOrientation orientation = [UIDevice currentDevice ].orientation ;
574
+
575
+ if (UIDeviceOrientationIsLandscape (orientation))
574
576
{
575
577
// 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;
577
579
rect.size .width = self.view .frame .size .width -STATUS_BAR_HEIGHT;
578
580
}
579
581
else
580
582
{
581
583
// 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 ;
583
585
rect.size .height = self.view .frame .size .height -STATUS_BAR_HEIGHT;
584
586
}
585
587
@@ -608,23 +610,23 @@ - (void)prepareMenuForReveal:(Menu)menu
608
610
- (CGFloat)horizontalLocation
609
611
{
610
612
CGRect rect = self.view .frame ;
611
- UIInterfaceOrientation orientation = self. interfaceOrientation ;
613
+ UIDeviceOrientation orientation = [UIDevice currentDevice ]. orientation ;
612
614
613
615
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO (@" 8.0" ))
614
616
{
615
617
return rect.origin .x ;
616
618
}
617
619
else
618
620
{
619
- if (UIInterfaceOrientationIsLandscape (orientation))
621
+ if (UIDeviceOrientationIsLandscape (orientation))
620
622
{
621
- return (orientation == UIInterfaceOrientationLandscapeRight )
623
+ return (orientation == UIDeviceOrientationLandscapeRight )
622
624
? rect.origin .y
623
625
: rect.origin .y *-1 ;
624
626
}
625
627
else
626
628
{
627
- return (orientation == UIInterfaceOrientationPortrait )
629
+ return (orientation == UIDeviceOrientationPortrait )
628
630
? rect.origin .x
629
631
: rect.origin .x *-1 ;
630
632
}
@@ -634,15 +636,15 @@ - (CGFloat)horizontalLocation
634
636
- (CGFloat)horizontalSize
635
637
{
636
638
CGRect rect = self.view .frame ;
637
- UIInterfaceOrientation orientation = self. interfaceOrientation ;
639
+ UIDeviceOrientation orientation = [UIDevice currentDevice ]. orientation ;
638
640
639
641
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO (@" 8.0" ))
640
642
{
641
643
return rect.size .width ;
642
644
}
643
645
else
644
646
{
645
- if (UIInterfaceOrientationIsLandscape (orientation))
647
+ if (UIDeviceOrientationIsLandscape (orientation))
646
648
{
647
649
return rect.size .height ;
648
650
}
@@ -675,7 +677,7 @@ - (void)navigationController:(UINavigationController *)navigationController
675
677
676
678
- (CGFloat)slideOffset
677
679
{
678
- return (UIInterfaceOrientationIsLandscape (self. interfaceOrientation ))
680
+ return (UIDeviceOrientationIsLandscape ([UIDevice currentDevice ]. orientation ))
679
681
? self.landscapeSlideOffset
680
682
: self.portraitSlideOffset ;
681
683
}
0 commit comments