UISystemGateGestureRecognizer and delayed taps near bottom of screen

后端 未结 2 1904
攒了一身酷
攒了一身酷 2020-12-15 20:25

What are the standard UISystemGestureGateGestureRecognizers installed on the top level UIView of an iOS app for?

My app consists of two vie

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-15 21:22

    It appears that these recognizers are meant to prevent accidental touches near the top and bottom of the screen. They aren't configured with any targets, but can (like any UIResponder) absorb touches to prevent them from being passed up the responder chain.

    Notes (tested on iOS 7.1):

    • Both gesture recognizers are always present in the key window.
    • I inspected both gestures' _targets ivar, and found they aren't configured with any targets at all. Swizzled out addTarget:action: to verify that targets weren't being added or removed on the fly.
    • delegate is always nil for both instances.
    • If you disable the gesture recognizers, they will re-enable themselves
    • The gesture that that doesn't delay content touches fires when you drag up from the bottom or drag down from the top. I couldn't trigger the instance that delays touches.

提交回复
热议问题