UISwipeGestureRecognizer not working

后端 未结 3 715
星月不相逢
星月不相逢 2021-01-07 13:37

I have a UIView inside of a UIScrollView, both created using IB. The UIView scrolls horizontally inside the UIScrollView. I want to detect left and right 2 finger swipes.

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-07 14:04

    The biggest difference between the sample code and your code is that your code involves a UIScrollView.

    Internally, scroll views, table views, and web views all use gesture recognizers to some degree. If you're expecting to receive gestures within those views – gestures that are similar to the ones already supported internally – they will almost certainly be consumed or significantly delayed before you can get to them. Receiving gestures outside or above those views should work fine, if your use case supports it.

提交回复
热议问题