iOS 7 has a great interactive animation for popping UIViewControllers. The transition is triggered by swiping from the left side of the screen but I would like to trigger the transition by swiping anywhere in my view controller. (I would also like to cancel the ones from the edge so I can use them for another custom transition...).
So far in my view controller I've added this in init. I know it's wrong, I'm not sure what I'm doing really.
UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleGesture:)];
panRecognizer.delegate = self.navigationController.interactivePopGestureRecognizer.delegate;
[self.view addGestureRecognizer:panRecognizer];
How do I tie it to the built in interactivePopGestureRecognizer? Should that be done in my handleGesture: method?
Edit: In Apple's documentation the word tie is actually used:
interactivePopGestureRecognizer
The navigation controller installs this gesture recognizer on its view and uses it to pop the topmost view controller off the navigation stack. You can use this property to retrieve the gesture recognizer and tie it to the behavior of other gesture recognizers in your user interface. When tying your gesture recognizers together, make sure they recognize their gestures simultaneously to ensure that your gesture recognizers are given a chance to handle the event.
How do you tie to UIGestureRecognizers together?