-
-
Save mikeabdullah/02aaad9625362a18e101 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewWillAppear:(BOOL)animated | |
{ | |
[super viewWillAppear:animated]; | |
BOOL inMultipleSelectionMode = (self.tableView.editing ? | |
self.tableView.allowsMultipleSelectionDuringEditing : | |
self.tableView.allowsMultipleSelection); | |
NSIndexPath *selectedRowIndexPath = [self.tableView indexPathForSelectedRow]; | |
if (selectedRowIndexPath && !inMultipleSelectionMode) { | |
[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