@@ -130,8 +130,6 @@ - (void)setUnderLeftViewController:(UIViewController *)theUnderLeftViewControlle
130
130
[self .underLeftViewController didMoveToParentViewController: self ];
131
131
132
132
[self updateUnderLeftLayout ];
133
-
134
- [self .view insertSubview: _underLeftViewController.view atIndex: 0 ];
135
133
}
136
134
}
137
135
@@ -148,8 +146,6 @@ - (void)setUnderRightViewController:(UIViewController *)theUnderRightViewControl
148
146
[self .underRightViewController didMoveToParentViewController: self ];
149
147
150
148
[self updateUnderRightLayout ];
151
-
152
- [self .view insertSubview: _underRightViewController.view atIndex: 0 ];
153
149
}
154
150
}
155
151
@@ -530,9 +526,9 @@ - (void)underLeftWillAppear
530
526
dispatch_async (dispatch_get_main_queue (), ^{
531
527
[[NSNotificationCenter defaultCenter ] postNotificationName: ECSlidingViewUnderLeftWillAppear object: self userInfo: nil ];
532
528
});
533
- self.underRightView . hidden = YES ;
529
+ [ self .underRightView removeFromSuperview ] ;
534
530
[self .underLeftViewController viewWillAppear: NO ];
535
- self.underLeftView . hidden = NO ;
531
+ [ self .view insertSubview: self .underLeftView belowSubview: self .topView] ;
536
532
[self updateUnderLeftLayout ];
537
533
_underLeftShowing = YES ;
538
534
_underRightShowing = NO ;
@@ -543,9 +539,9 @@ - (void)underRightWillAppear
543
539
dispatch_async (dispatch_get_main_queue (), ^{
544
540
[[NSNotificationCenter defaultCenter ] postNotificationName: ECSlidingViewUnderRightWillAppear object: self userInfo: nil ];
545
541
});
546
- self.underLeftView . hidden = YES ;
542
+ [ self .underLeftView removeFromSuperview ] ;
547
543
[self .underRightViewController viewWillAppear: NO ];
548
- self.underRightView . hidden = NO ;
544
+ [ self .view insertSubview: self .underRightView belowSubview: self .topView] ;
549
545
[self updateUnderRightLayout ];
550
546
_underLeftShowing = NO ;
551
547
_underRightShowing = YES ;
@@ -559,6 +555,8 @@ - (void)topDidReset
559
555
[self .topView removeGestureRecognizer: self .resetTapGesture];
560
556
[self removeTopViewSnapshot ];
561
557
self.panGesture .enabled = YES ;
558
+ [self .underRightView removeFromSuperview ];
559
+ [self .underLeftView removeFromSuperview ];
562
560
_underLeftShowing = NO ;
563
561
_underRightShowing = NO ;
564
562
_topViewIsOffScreen = NO ;
0 commit comments