Passing touch events to appropriate sibling UIViews

后端 未结 2 1223
梦如初夏
梦如初夏 2021-02-13 20:58

I\'m trying to handle touch events with touchesBegan in an overlay to a parent UIView but also allow the touch input to pass through to sibling U

2条回答
  •  感情败类
    2021-02-13 21:29

    Late answer, but I think you would be better off overriding hitTest:withEvent: instead of touchesBegan. It seems to me that touchesBegan is a pretty "high-level" method that is there to just do a simple thing, so you cannot alter at that level if the event if propagated further. The right place to do that is hitTest:withEvent:.

    Also have a look at this S.O. answer for more details about this point.

提交回复
热议问题