Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
ChavezChen committed Aug 9, 2018
1 parent f290439 commit 2c85215
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Binary file modified .DS_Store
Binary file not shown.
14 changes: 10 additions & 4 deletions CWLateralSlide/CWDrawerTransition.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,12 @@ - (void)animationViewHidden:(id <UIViewControllerContextTransitioning>)transitio
UIViewController *toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];

CWMaskView *maskView = [CWMaskView shareInstance];
for (UIView *view in toVC.view.subviews) {
if (![maskView.toViewSubViews containsObject:view]) {
[view removeFromSuperview];
// 导航控制器的navigationBar在导航栏先隐藏后显示的情况下会被删除,所以过滤掉导航控制器
if (![toVC isKindOfClass:[UINavigationController class]]) {
for (UIView *view in toVC.view.subviews) {
if (![maskView.toViewSubViews containsObject:view]) {
[view removeFromSuperview];
}
}
}

Expand Down Expand Up @@ -164,7 +167,10 @@ - (void)defaultAnimationWithContext:(id <UIViewControllerContextTransitioning>)t
} completion:^(BOOL finished) {
if (![transitionContext transitionWasCancelled]) {
maskView.userInteractionEnabled = YES;
maskView.toViewSubViews = fromVC.view.subviews;
// 导航控制器的navigationbar可能是先隐藏再显示,这里会不在fromVC.view.subviews,上面移除时会有问题
if (![toVC isKindOfClass:[UINavigationController class]]) {
maskView.toViewSubViews = fromVC.view.subviews;
}
[transitionContext completeTransition:YES];
[containerView addSubview:fromVC.view];
}else {
Expand Down
Binary file not shown.

0 comments on commit 2c85215

Please sign in to comment.