UIGestureRecognizer blocks subview for handling touch events

后端 未结 10 1085
北恋
北恋 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条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-28 19:59

    One possibility is to subclass your gesture recognizer (if you haven't already) and override -touchesBegan:withEvent: such that it determines whether each touch began in an excluded subview and calls -ignoreTouch:forEvent: for that touch if it did.

    Obviously, you'll also need to add a property to keep track of the excluded subview, or perhaps better, an array of excluded subviews.

提交回复
热议问题