How to response a touch event which begin to touch down outside of a view and drag enter it in iOS

前端 未结 1 1223
后悔当初
后悔当初 2020-12-22 13:02

I want to response this kind of touch event on a view:begin to touch down outside of the view and drag enter it. I have tried to use the iOS UIControlEvent such as UIControl

相关标签:
1条回答
  • 2020-12-22 13:41

    begin to touch down outside of the view and drag enter it

    You can never do this more "elegantly" because if your initial touch down is outside the view, then it is not associated with this view and never will be. Whatever view the touch's initial hit test associates it with, that is the view that will always be this touch's view throughout the gesture, and touch events will be sent only to that view. The default definition of hit testing is that the view that the initial touch is inside is the hit-test view, and that, by hypothesis, is not your view.

    0 讨论(0)
提交回复
热议问题