How to pass a 'tap' to UIButton that is underneath UIView with UISwipeGestureRecognizer?

后端 未结 4 1847
伪装坚强ぢ
伪装坚强ぢ 2021-02-07 13:09

I have a UIButton underneath a (transparent) UIView. The UIView above has a UISwipeGestureRecognizer added to it, and that is its only purpose - to detect certain swipe gestures

4条回答
  •  你的背包
    2021-02-07 13:34

    Can't you put your button on top of the view and add gesture recognisers to that button too?

    In the end, your UIButton inherits form UIView via UIControl. Therefore there is practically nothing that you could do with a view but not with a button.

提交回复
热议问题