Library / Outcomes & notifications

Success (task completed)

A user-initiated task finishes: form submitted, file saved, order placed.

0ms 100ms 200ms 300ms 400ms
Feel
Two quick taps with a rising feel — the system success pattern.
APIs
.sensoryFeedback(.success)UINotificationFeedbackGenerator(.success)
Minimum OS
iOS 17+ / iOS 10+
Raw .md
SwiftUI (iOS 17+)
import SwiftUI

struct SaveButton: View {
    @State private var saved = false

    var body: some View {
        Button {
            Task {
                try? await save()
                withAnimation { saved = true }
            }
        } label: {
            Label(saved ? "Saved" : "Save", 
                  systemImage: saved ? "checkmark" : "square.and.arrow.down")
        }
        .sensoryFeedback(.success, trigger: saved) { _, new in new }
    }

    func save() async throws { try await Task.sleep(for: .seconds(0.5)) }
}
UIKit
let haptic = UINotificationFeedbackGenerator()

func submitForm() {
    haptic.prepare() // before the async work finishes
    api.submit { result in
        DispatchQueue.main.async {
            haptic.notificationOccurred(.success)
            // show confirmation UI at the same instant
        }
    }
}
Copied