mapbox / mapbox/mapbox-maps-ios

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

Open
#1,560 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged feature :green_apple:
Dominant language
Swift
Stars
601
Forks
196
PR merge metrics
No merged PRs in 30d

Description

## 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](https://github.com/mapbox/mapbox-maps-ios/pull/1113/files#diff-2118c6d8d6532a74869edccb411adbd32bc698c2d2557be7d899484e975570feR133)). 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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting GestureManager's internal initializer and the require(toFail:) relationship described in the issue, then trace how clients configure map gestures. Determine where an opt-out flag or delegation hook could be exposed without changing the default behavior. Done means clients can disable the failure dependency so single- and double-tap gestures recognize simultaneously, while existing behavior remains unchanged by default.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.