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

前端 未结 2 1782
遥遥无期
遥遥无期 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:39

    you have to override canBecomeFirstResponder to return YES otherwise becomeFirstResponder does nothing. This is already done on UIControls, but not on UIViews

提交回复
热议问题