Skip to content

Commit

Permalink
TransitionView 加入dismiss回调
Browse files Browse the repository at this point in the history
  • Loading branch information
Gdxy committed Jun 20, 2019
1 parent c6e9f48 commit 73036bc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 0 additions & 1 deletion Example/Example/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

#import "AppDelegate.h"
#import "TLCodeViewConroller.h"
#import "TLPopoverMenuController.h"
#import "TLModalMenuController.h"
#import "TLNavTransitionMenuController.h"
Expand Down
2 changes: 2 additions & 0 deletions TLTransitions/TransitionView/TLTransition.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ typedef void(^TLAnimateForTransition)(id <UIViewControllerContextTransitioning>
* 如果popView没有被引用,在隐藏后也会自动释放
*/
- (void)dismiss;
- (void)dismissWithCompletion: (void (^ __nullable)(void))completion;
- (void)dismissViewControllerAnimated: (BOOL)flag completion: (void (^ __nullable)(void))completion;

/**
* 实时更新view的size ,显示后也可以更新
Expand Down
10 changes: 9 additions & 1 deletion TLTransitions/TransitionView/TLTransition.m
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,15 @@ - (void)tap:(UITapGestureRecognizer *)tap {
}

- (void)dismiss {
[self.presentedViewController dismissViewControllerAnimated:YES completion:nil];
[self dismissViewControllerAnimated:YES completion:nil];
}

- (void)dismissWithCompletion: (void (^ __nullable)(void))completion {
[self dismissViewControllerAnimated:YES completion:completion];
}

- (void)dismissViewControllerAnimated: (BOOL)flag completion: (void (^ __nullable)(void))completion {
[self.presentedViewController dismissViewControllerAnimated:flag completion:completion];
}


Expand Down

0 comments on commit 73036bc

Please sign in to comment.