How can I pass a gesture recognizer from one view to another

后端 未结 1 461
忘了有多久
忘了有多久 2021-01-05 05:58

I have a view which contains several subviews which are complex controls with several buttons. The superview has gesture recognizers for taps, swipes etc.

In some ca

相关标签:
1条回答
  • 2021-01-05 06:27

    Well, you could create a custom view inheriting from UIView and then override:

    - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
    

    From this method you can return the view you want to handle the event.

    take a look at: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html#//apple_ref/occ/instm/UIView/hitTest:withEvent:

    0 讨论(0)
提交回复
热议问题