diff --git a/Example/Example/AppDelegate.m b/Example/Example/AppDelegate.m index 4100de3..09f714e 100644 --- a/Example/Example/AppDelegate.m +++ b/Example/Example/AppDelegate.m @@ -7,7 +7,6 @@ // #import "AppDelegate.h" -#import "TLCodeViewConroller.h" #import "TLPopoverMenuController.h" #import "TLModalMenuController.h" #import "TLNavTransitionMenuController.h" diff --git a/TLTransitions/TransitionView/TLTransition.h b/TLTransitions/TransitionView/TLTransition.h index bd50a8d..901871e 100644 --- a/TLTransitions/TransitionView/TLTransition.h +++ b/TLTransitions/TransitionView/TLTransition.h @@ -89,6 +89,8 @@ typedef void(^TLAnimateForTransition)(id * 如果popView没有被引用,在隐藏后也会自动释放 */ - (void)dismiss; +- (void)dismissWithCompletion: (void (^ __nullable)(void))completion; +- (void)dismissViewControllerAnimated: (BOOL)flag completion: (void (^ __nullable)(void))completion; /** * 实时更新view的size ,显示后也可以更新 diff --git a/TLTransitions/TransitionView/TLTransition.m b/TLTransitions/TransitionView/TLTransition.m index b03b48e..43f4c4e 100644 --- a/TLTransitions/TransitionView/TLTransition.m +++ b/TLTransitions/TransitionView/TLTransition.m @@ -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]; }