mapbox-maps-ios icon indicating copy to clipboard operation
mapbox-maps-ios copied to clipboard

Allow clients to conditionally set the failure dependency between the single and double tap gestures

Open johnnewman opened this issue 3 years ago • 0 comments

New Feature

With the changes in Mapbox 10.4.0 and above, the single tap gesture is delayed before it is recognized. This is due to the 10.4.0 change that requires the failure of the map's double tap gesture before the single tap gesture is recognized. (Link to the code change here). It would be great if this could be conditionalized, so that clients could opt out of this dependency, allowing both gestures to recognize simultaneously. This could be done via a flag or by delegation, instead of using the require(toFail:) API in the internal initializer of GestureManager.

Why

In our app, this new gesture dependency causes the single-tap selection of map annotations to be noticeably slower. This makes the app feel sluggish. If we could conditionally disable this dependency, that would make the single tap gesture much faster. It's understood that this would revert the tap behavior to the way it was pre-10.4.0, where the double tap gesture fires simultaneously with the single tap gesture. This may not be desirable to all clients, so I believe being able to conditionalize this dependency would be best!

johnnewman avatar Sep 07 '22 18:09 johnnewman