I have a UILongPressGestureRecognizer that fires the method -(void)didPress. The current view has by default a UIImage. didPress makes the UIImage disappear off the screen. However, the image should only disappear off the screen as long as the user is still long pressing. Once the user lets go of the initial long press, the image reappears. I have the code already to handle the initial long press, but I’m not sure how to determine when the user has let go of that long touch.
I have a UILongPressGestureRecognizer that fires the method -(void)didPress . The current view has
Share
You should pass the UILongPressGestureRecognizer to your method and check the state of the gesture, when the user releases his finger/fingers out of the screen, it will send a state of UIGestureRecognizerStateEnded
Using touchesBegan:withEvent: is old and way before UIGestureRecognizer’s