0
votes

I have set the left back button item of a navigation controller to a custom view and have set up a tap gesture recognizer for it, now when the custom view receives a tap gesture it pops the current view controllers vie of a stack of navigation controllers.

I want to now switch the view when the back button is tapped, and still maintain the functionality similar to a button, like I long press it and it will only pop the current view controller once I have let go.

1

1 Answers

0
votes

You can add a UILongPressGestureRecognizer to your custom view in addition to the tap recognizer.

Note that UILongPressGestureRecognizer is a continuous recognizer: one long-press will generate several action messages. You need to check for state UIGestureRecognizerStateEnded in your handler.