Skip to content

Instantly share code, notes, and snippets.

@ppm
Created October 31, 2013 18:07
Show Gist options
  • Save ppm/7254204 to your computer and use it in GitHub Desktop.
Save ppm/7254204 to your computer and use it in GitHub Desktop.
Response to animated/interactive UIViewController transition.
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self.transitionCoordinator animateAlongsideTransition:nil completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
if ( [context initiallyInteractive] ) return;
[self _onTransitionEnd:context];
}];
[self.transitionCoordinator notifyWhenInteractionEndsUsingBlock:^(id<UIViewControllerTransitionCoordinatorContext> context) {
[self _onTransitionEnd:context];
}];
}
- (void)_onTransitionEnd:(id<UIViewControllerTransitionCoordinatorContext>)context
{
if ( [context isCancelled] ) {
}
else {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment