UIGestureRecognizer blocks subview for handling touch events

后端 未结 10 1083
北恋
北恋 2020-11-28 19:32

I\'m trying to figure out how this is done the right way. I\'ve tried to depict the situation: \"enter

10条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 20:04

    I had a very similar problem and found my solution in this SO question. In summary, set yourself as the delegate for your UIGestureRecognizer and then check the targeted view before allowing your recognizer to process the touch. The relevant delegate method is:

    - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
           shouldReceiveTouch:(UITouch *)touch
    

提交回复
热议问题