How to “transfer” first responder from one UIView to another?

前端 未结 2 1783
遥遥无期
遥遥无期 2021-01-06 22:06

I have a UIView subclass (CustomView for purposes of this question) that has its own handling of all touches events (Began, Moved, Ended, Cancelled

2条回答
  •  一个人的身影
    2021-01-06 22:47

    Just use hitTest:withEvent: to figure out what view "should" be receiving the event, then forward on the event to the appropriate view. You might have to do a little bit of dancing around to intercept events before they go to the button, but this is what hitTest:withEvent: was made for.

提交回复
热议问题