Skip to content

Instantly share code, notes, and snippets.

@Air-Craft
Created February 11, 2015 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Air-Craft/275983a7e27fa2f97b07 to your computer and use it in GitHub Desktop.
Save Air-Craft/275983a7e27fa2f97b07 to your computer and use it in GitHub Desktop.
Push a VC onto UINavigationController with completion callback #ios #transitions #intermediate
- (void)pushViewController:(UIViewController *)viewController
animated:(BOOL)animated
completion:(void (^)(BOOL finished))completion
{
[self pushViewController:viewController animated:animated];
if (animated) {
[self.transitionCoordinator
animateAlongsideTransition:nil
completion:^(id<UIViewControllerTransitionCoordinatorContext> context)
{
completion ? completion(![context isCancelled]) : nil;
}];
} else {
completion ? completion(YES) : nil;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment