iOS - Detecting touches in a UIView?

前端 未结 4 533
无人共我
无人共我 2021-01-12 01:55

So I have a Subclass of UIView that is suppose to detect touches. The view detect touches only if the touches started inside the current view. When the touches start outside

4条回答
  •  离开以前
    2021-01-12 02:19

    One way to do it (though there might be others) is to disable user interaction for the subviews and make their parent view track the movement (use the hitTest method to figure out which view the touch is currently over).

提交回复
热议问题