开发者

Detect touches which started outside of view

开发者 https://www.devze.com 2023-01-28 17:20 出处:网络
Is there a way to detect touches when the gesture started outside of the current view? 开发者_JS百科

Is there a way to detect touches when the gesture started outside of the current view?

开发者_JS百科

Example:

I have a small view where I detect touches.

User starte moving finger on screen, starting outside of by view and then enters it without lifting finger.

When finger enters view, the view does not get any touch events.


Override pointInside:withEvent: in your view and that should do it, though the point has to be within the parent view and the child view has to be visible and have user interaction enabled.


I remember a method that you can add a custom transparent UIButton, which cover all screen. And any touch outside of another view will trigger this UIButton event.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号