Allow UIScrollView and its subviews to both respond to a touch

前端 未结 5 571
轮回少年
轮回少年 2020-12-04 16:11

I want both my UIScrollView and its subviews to receive all touch events inside the subview. Each can respond in its own way.

Alternatively, if tap gestures were fo

5条回答
  •  庸人自扰
    2020-12-04 16:24

    If what you need is to differ between a touch and a scroll then you can test if touches has been moved. If this is a tap then touchHasBeenMoved will not be called then you can assume this is a touch.

    At this point you can set a boolean to indicate if a movnent accoured and set this Boolean as a condition in your other methods.

    I am on the road but if that's what you need I will be able to explain better later.

提交回复
热议问题