| 123456789101112131415161718192021222324252627282930313233343536373839 |
- //
- // UINavigationController+CompletionBlock.m
- // OneCable
- //
- // Created by ncomz on 2017. 6. 28..
- // Copyright © 2017년 ntels. All rights reserved.
- //
- #import "UINavigationController+CompletionBlock.h"
- @implementation UINavigationController (CompletionBlock)
- - (UIViewController *)popViewControllerAnimated:(BOOL)animated completion:(void (^)()) completion {
- [CATransaction begin];
- [CATransaction setCompletionBlock:^{
- completion();
- }];
-
- UIViewController *vc = [self popViewControllerAnimated:animated];
-
- [CATransaction commit];
-
- return vc;
- }
- - (NSArray< UIViewController *> *)popToRootViewControllerAnimated:(BOOL)animated completion:(void (^)()) completion {
- [CATransaction begin];
- [CATransaction setCompletionBlock:^{
- completion();
- }];
-
- NSArray< UIViewController *> *vcs = [self popToRootViewControllerAnimated:animated];
-
- [CATransaction commit];
-
- return vcs;
- }
- @end
|