Fix swipe-back-to-pop gesture.
The interactivePopGestureRecognizer machinery doesn't work when you have a custom back button. // FREEBIE
This commit is contained in:
parent
0a09330d35
commit
c182a05961
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue