Deselect table rows when swiping back in table views

// FREEBIE
pull/1/head
Michael Kirk 9 years ago
parent 7e67fb1939
commit 019310f284

@ -65,6 +65,9 @@ int const OWSLinkedDevicesTableViewControllerSectionAddDevice = 1;
{ {
[super viewWillAppear:animated]; [super viewWillAppear:animated];
[self refreshDevices]; [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 - (void)viewWillDisappear:(BOOL)animated

@ -85,6 +85,14 @@ typedef enum {
forState:UIControlStateNormal]; 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 { - (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self name:SocketOpenedNotification object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self name:SocketOpenedNotification object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:SocketClosedNotification object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self name:SocketClosedNotification object:nil];

Loading…
Cancel
Save