Tap events not dispatched in new view added with addSubview

I have an area of ​​my screen where I want to recognize a long print. I am using UILongPressGestureRecognizer.

As soon as the long press event occurs, I show a custom UIView that has a method touchesMoved

, adding it as a subview. This custom UIView is added right in the center where the long print event happened, it's right under my finger.

Problem: If I keep holding my finger after long press, touchesMoved

in the custom UIView is not called. Only when I lift my finger and touch again is the method recognized touchesMoved

.

Any possible solutions? I believe the problem is that when the touch started, it originated from the main view. Even though I add a new UIView on top of the hierarchy and move my finger over it, it is not recognized i.e. touchesMoved

not called because the view entered the hierarchy after the strokes started.

I've tried a couple of things to reverse the long gesture recognizer but nothing seems to work. Thank.

+3
ios uigesturerecognizer touchesmoved


source to share


No one has answered this question yet

Check out similar questions:

93
Invoke gesture recognizer and button actions
54
Forcing UIGesture to View Mode
3
Long-lasting tap gesture recognition problem
1
kickstarting touchsMoved / UIPanGestureRecognizer in the middle of a move for a new view
1
TouchesMoved stops firing for no reason
0
How do I handle touch events and gesture events on a UIButton?
0
How do I enable one touch to handle both UILongPressGestureRecognizer and UIPanGestureRecognizer?
0
UILongPressGestures Conflict
0
Switch to a different view controller (iOS)
0
Passing strokes to the parent view controller after gesture recognition completes



All Articles
Loading...
X
Show
Funny
Dev
Pics