Skip to content

Instantly share code, notes, and snippets.

@mikeabdullah
Forked from prendio2/SUPTableViewController.m
Last active August 29, 2015 14:10
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 mikeabdullah/9175b838f78d895978b7 to your computer and use it in GitHub Desktop.
Save mikeabdullah/9175b838f78d895978b7 to your computer and use it in GitHub Desktop.
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
NSIndexPath *selectedRowIndexPath = [self.tableView indexPathForSelectedRow];
if (selectedRowIndexPath) {
[self.transitionCoordination animateAlongsideTransitionInView:self.tableView animation:^(id<UIViewControllerTransitionCoordinatorContext> context) {
[self.tableView deselectRowAtIndexPath:selectedRowIndexPath animated:YES];
} completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
if (context.isCancelled) {
[self.tableView selectRowAtIndexPath:selectedRowIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
}
}];
}
}
@pronebird
Copy link

self.transitionCoordination -> self.transitionCoordinator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment