Library / Outcomes & notifications

Payment complete (custom double-pulse)

An Apple Pay-style confirmation: a soft pre-tap followed by a strong full-body pulse.

0ms 100ms 200ms 300ms 400ms
Feel
A quiet "ready" tick, a beat of silence, then one deep confident thump. More ceremonial than plain success.
APIs
CHHapticEventCHHapticPattern
Minimum OS
iOS 13+
Raw .md
Core Haptics
import CoreHaptics

func playPaymentSuccess(engine: CHHapticEngine) throws {
    let ready = CHHapticEvent(
        eventType: .hapticTransient,
        parameters: [
            CHHapticEventParameter(parameterID: .hapticIntensity, value: 0.4),
            CHHapticEventParameter(parameterID: .hapticSharpness, value: 0.7),
        ],
        relativeTime: 0)

    // A short continuous event reads as a "thump" rather than a tick
    let thump = CHHapticEvent(
        eventType: .hapticContinuous,
        parameters: [
            CHHapticEventParameter(parameterID: .hapticIntensity, value: 1.0),
            CHHapticEventParameter(parameterID: .hapticSharpness, value: 0.3),
        ],
        relativeTime: 0.25,
        duration: 0.13)

    let pattern = try CHHapticPattern(events: [ready, thump], parameters: [])
    let player = try engine.makePlayer(with: pattern)
    try engine.start()
    try player.start(atTime: CHHapticTimeImmediate)
}

// Fallback for devices without Core Haptics:
// UINotificationFeedbackGenerator().notificationOccurred(.success)
Copied