Skip to content

Commit c29ec93

Browse files
MrBendelenriquez
authored andcommitted
Fix under navigation controller animations
1 parent f3b3220 commit c29ec93

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

ECSlidingViewController/Vendor/ECSlidingViewController/ECSlidingViewController.m

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ - (void)setUnderLeftViewController:(UIViewController *)theUnderLeftViewControlle
130130
[self.underLeftViewController didMoveToParentViewController:self];
131131

132132
[self updateUnderLeftLayout];
133-
134-
[self.view insertSubview:_underLeftViewController.view atIndex:0];
135133
}
136134
}
137135

@@ -148,8 +146,6 @@ - (void)setUnderRightViewController:(UIViewController *)theUnderRightViewControl
148146
[self.underRightViewController didMoveToParentViewController:self];
149147

150148
[self updateUnderRightLayout];
151-
152-
[self.view insertSubview:_underRightViewController.view atIndex:0];
153149
}
154150
}
155151

@@ -530,9 +526,9 @@ - (void)underLeftWillAppear
530526
dispatch_async(dispatch_get_main_queue(), ^{
531527
[[NSNotificationCenter defaultCenter] postNotificationName:ECSlidingViewUnderLeftWillAppear object:self userInfo:nil];
532528
});
533-
self.underRightView.hidden = YES;
529+
[self.underRightView removeFromSuperview];
534530
[self.underLeftViewController viewWillAppear:NO];
535-
self.underLeftView.hidden = NO;
531+
[self.view insertSubview:self.underLeftView belowSubview:self.topView];
536532
[self updateUnderLeftLayout];
537533
_underLeftShowing = YES;
538534
_underRightShowing = NO;
@@ -543,9 +539,9 @@ - (void)underRightWillAppear
543539
dispatch_async(dispatch_get_main_queue(), ^{
544540
[[NSNotificationCenter defaultCenter] postNotificationName:ECSlidingViewUnderRightWillAppear object:self userInfo:nil];
545541
});
546-
self.underLeftView.hidden = YES;
542+
[self.underLeftView removeFromSuperview];
547543
[self.underRightViewController viewWillAppear:NO];
548-
self.underRightView.hidden = NO;
544+
[self.view insertSubview:self.underRightView belowSubview:self.topView];
549545
[self updateUnderRightLayout];
550546
_underLeftShowing = NO;
551547
_underRightShowing = YES;
@@ -559,6 +555,8 @@ - (void)topDidReset
559555
[self.topView removeGestureRecognizer:self.resetTapGesture];
560556
[self removeTopViewSnapshot];
561557
self.panGesture.enabled = YES;
558+
[self.underRightView removeFromSuperview];
559+
[self.underLeftView removeFromSuperview];
562560
_underLeftShowing = NO;
563561
_underRightShowing = NO;
564562
_topViewIsOffScreen = NO;

0 commit comments

Comments
 (0)