Swift: hitTest for UIView underneath another UIView

后端 未结 4 1492
闹比i
闹比i 2021-01-06 08:48

I have TransparentUIView on top of RedOrGreenUIView. TransparentUIView has a UILongPressGestureRecognizer attached to it. Once user begins a long touch on it, I check for .C

4条回答
  •  借酒劲吻你
    2021-01-06 09:13

    If one UIView gets touches, others underneath don't get any.

    So either you can have a central class that passes touches to both your UIView objects, or the first UIView, the one that is on top, passes its UITouch object to the UIView underneath and conducts the hitTest.

提交回复
热议问题