diff --git a/Signal/src/view controllers/MessagesViewController.m b/Signal/src/view controllers/MessagesViewController.m index 14d65cba1..7142e9cff 100644 --- a/Signal/src/view controllers/MessagesViewController.m +++ b/Signal/src/view controllers/MessagesViewController.m @@ -462,6 +462,9 @@ typedef enum : NSUInteger { { [super viewWillAppear:animated]; + // Since we're using a custom back button, we have to do some extra work to manage the interactivePopGestureRecognizer + self.navigationController.interactivePopGestureRecognizer.delegate = self; + // We need to recheck on every appearance, since the user may have left the group in the settings VC, // or on another device. [self hideInputIfNeeded]; @@ -543,6 +546,9 @@ typedef enum : NSUInteger { [super viewWillDisappear:animated]; [self toggleObservers:NO]; + // Since we're using a custom back button, we have to do some extra work to manage the interactivePopGestureRecognizer + self.navigationController.interactivePopGestureRecognizer.delegate = nil; + [_unreadContainer removeFromSuperview]; _unreadContainer = nil; diff --git a/Signal/src/view controllers/OWSConversationSettingsTableViewController.m b/Signal/src/view controllers/OWSConversationSettingsTableViewController.m index 9b24646ea..2369ef431 100644 --- a/Signal/src/view controllers/OWSConversationSettingsTableViewController.m +++ b/Signal/src/view controllers/OWSConversationSettingsTableViewController.m @@ -211,6 +211,10 @@ static NSString *const OWSConversationSettingsTableViewControllerSegueShowGroupM - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; + + // Since we're using a custom back button, we have to do some extra work to manage the interactivePopGestureRecognizer + self.navigationController.interactivePopGestureRecognizer.delegate = self; + // 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]; @@ -220,6 +224,9 @@ static NSString *const OWSConversationSettingsTableViewControllerSegueShowGroupM { [super viewWillDisappear:animated]; + // Since we're using a custom back button, we have to do some extra work to manage the interactivePopGestureRecognizer + self.navigationController.interactivePopGestureRecognizer.delegate = nil; + if (self.disappearingMessagesConfiguration.isNewRecord && !self.disappearingMessagesConfiguration.isEnabled) { // don't save defaults, else we'll unintentionally save the configuration and notify the contact. return;