Deselect table rows when swiping back in table views

// FREEBIE
This commit is contained in:
Michael Kirk 2016-09-07 22:50:21 -04:00
parent 7e67fb1939
commit 019310f284
2 changed files with 11 additions and 0 deletions

View File

@ -65,6 +65,9 @@ int const OWSLinkedDevicesTableViewControllerSectionAddDevice = 1;
{
[super viewWillAppear:animated];
[self refreshDevices];
// HACK to unselect rows when swiping back
// http://stackoverflow.com/questions/19379510/uitableviewcell-doesnt-get-deselected-when-swiping-back-quickly
[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:animated];
}
- (void)viewWillDisappear:(BOOL)animated

View File

@ -85,6 +85,14 @@ typedef enum {
forState:UIControlStateNormal];
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
// HACK to unselect rows when swiping back
// http://stackoverflow.com/questions/19379510/uitableviewcell-doesnt-get-deselected-when-swiping-back-quickly
[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:animated];
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self name:SocketOpenedNotification object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:SocketClosedNotification object:nil];