Double-tap Timeout Value?

How do I access the value in Settings → Accessibility → Double-tap Timeout?

More details:

I'm making a game with a SpriteView in SwiftUI that needs to react immediate to a touch while also detecting and responding to double, triple, and quadruple taps. To do this, I have the following:

var touch: some Gesture {
    var lastTouchTime = Date.now
    var tapCounter = 1

    return DragGesture(minimumDistance: 0, coordinateSpace: .local)
        .onChanged() { touch in
            // Respond immediately to touch.
        }
        .onEnded() { touch in
            if lastTouchTime.timeIntervalSinceNow > -0.25 {
                tapCounter += 1
            } else {
                tapCounter = 1
            }
            switch tapCounter {
            case 1:
                break
            case 2:
                // Respond to double-tap.
            case 3:
                // Respond to triple-tap.
            default:
                // Respond to quadruple tap.
                // Quintuple, sextuple, etc. taps also resolve here, which is fine.
            }
            lastTouchTime = Date.now
        }
}

I would like to substitute 0.25 with the user's value in Accessibility settings, but I do not know how to access this value.

The following does not work:

.gesture(doubleTap)
.gesture(singleTap)

SwiftUI waits for the double-tap to fail before reacting to the single tap, which is not what I need, plus stacking triple and quadruple taps on top of this just fails.

Answered by Engineer in 719031022

I believe you're referencing the value in VoiceOver settings? This value is for VoiceOver only, and doesn't apply to double taps when VoiceOver is not on. This is not a setting accessible to developers or other apps.

Accepted Answer

I believe you're referencing the value in VoiceOver settings? This value is for VoiceOver only, and doesn't apply to double taps when VoiceOver is not on. This is not a setting accessible to developers or other apps.

Yes, that is what I was referring to. Incorrect information elsewhere on the web gave the impression that this changes double taps globally. Thank you for the clarification.

Double-tap Timeout Value?
 
 
Q