Skip to content

Instantly share code, notes, and snippets.

@seivan
Forked from prendio2/SUPTableViewController.m
Created March 26, 2014 20:24
Show Gist options
  • Save seivan/9792451 to your computer and use it in GitHub Desktop.
Save seivan/9792451 to your computer and use it in GitHub Desktop.
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
NSIndexPath *selectedRowIndexPath = [self.tableView indexPathForSelectedRow];
if (selectedRowIndexPath) {
[self.tableView deselectRowAtIndexPath:selectedRowIndexPath animated:YES];
[[self transitionCoordinator] notifyWhenInteractionEndsUsingBlock:^(id<UIViewControllerTransitionCoordinatorContext> context) {
if ([context isCancelled]) {
[self.tableView selectRowAtIndexPath:selectedRowIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
}
}];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment