diff --git a/ECSlidingViewController/Vendor/ECSlidingViewController/ECSlidingViewController.m b/ECSlidingViewController/Vendor/ECSlidingViewController/ECSlidingViewController.m index d1fcf6d..6ee1106 100644 --- a/ECSlidingViewController/Vendor/ECSlidingViewController/ECSlidingViewController.m +++ b/ECSlidingViewController/Vendor/ECSlidingViewController/ECSlidingViewController.m @@ -130,8 +130,6 @@ NSString *const ECSlidingViewTopDidReset = @"ECSlidingViewTopDidRese [self.underLeftViewController didMoveToParentViewController:self]; [self updateUnderLeftLayout]; - - [self.view insertSubview:_underLeftViewController.view atIndex:0]; } } @@ -148,8 +146,6 @@ NSString *const ECSlidingViewTopDidReset = @"ECSlidingViewTopDidRese [self.underRightViewController didMoveToParentViewController:self]; [self updateUnderRightLayout]; - - [self.view insertSubview:_underRightViewController.view atIndex:0]; } } @@ -530,9 +526,9 @@ NSString *const ECSlidingViewTopDidReset = @"ECSlidingViewTopDidRese dispatch_async(dispatch_get_main_queue(), ^{ [[NSNotificationCenter defaultCenter] postNotificationName:ECSlidingViewUnderLeftWillAppear object:self userInfo:nil]; }); - self.underRightView.hidden = YES; + [self.underRightView removeFromSuperview]; [self.underLeftViewController viewWillAppear:NO]; - self.underLeftView.hidden = NO; + [self.view insertSubview:self.underLeftView belowSubview:self.topView]; [self updateUnderLeftLayout]; _underLeftShowing = YES; _underRightShowing = NO; @@ -543,9 +539,9 @@ NSString *const ECSlidingViewTopDidReset = @"ECSlidingViewTopDidRese dispatch_async(dispatch_get_main_queue(), ^{ [[NSNotificationCenter defaultCenter] postNotificationName:ECSlidingViewUnderRightWillAppear object:self userInfo:nil]; }); - self.underLeftView.hidden = YES; + [self.underLeftView removeFromSuperview]; [self.underRightViewController viewWillAppear:NO]; - self.underRightView.hidden = NO; + [self.view insertSubview:self.underRightView belowSubview:self.topView]; [self updateUnderRightLayout]; _underLeftShowing = NO; _underRightShowing = YES; @@ -559,6 +555,8 @@ NSString *const ECSlidingViewTopDidReset = @"ECSlidingViewTopDidRese [self.topView removeGestureRecognizer:self.resetTapGesture]; [self removeTopViewSnapshot]; self.panGesture.enabled = YES; + [self.underRightView removeFromSuperview]; + [self.underLeftView removeFromSuperview]; _underLeftShowing = NO; _underRightShowing = NO; _topViewIsOffScreen = NO;