## UIKit feedback generator cheat sheet

- Use case: All three UIFeedbackGenerator families and every style, with the prepare → fire pattern.
- Feel: Impacts = collisions. Selection = ticks. Notification = three-part outcome patterns.
- APIs: UIImpactFeedbackGenerator, UISelectionFeedbackGenerator, UINotificationFeedbackGenerator
- Minimum OS: iOS 10+ (intensity: iOS 13+)

### UIKit

```swift
import UIKit

// ---------------------------------------------------------------
// 1. IMPACT — a physical collision or snap
// Styles: .light  .medium  .heavy   (mass of the object)
//         .soft   .rigid            (stiffness of the object)
// ---------------------------------------------------------------
let impact = UIImpactFeedbackGenerator(style: .medium)
impact.prepare()                    // on touch-down / screen appear
impact.impactOccurred()             // full strength
impact.impactOccurred(intensity: 0.6) // scaled, 0.0–1.0 (iOS 13+)

// ---------------------------------------------------------------
// 2. SELECTION — ticks while the user moves through values
//    (picker rows, segmented controls, dial detents)
// ---------------------------------------------------------------
let selection = UISelectionFeedbackGenerator()
selection.prepare()
selection.selectionChanged()        // call once per value change

// ---------------------------------------------------------------
// 3. NOTIFICATION — the outcome of a task
// ---------------------------------------------------------------
let note = UINotificationFeedbackGenerator()
note.prepare()
note.notificationOccurred(.success) // two quick taps, rising
note.notificationOccurred(.warning) // two taps, falling
note.notificationOccurred(.error)   // three sharp buzzes

// iOS 17.5+: attach the generator to a view so the system can
// route feedback correctly on devices with multiple engines.
let attached = UIImpactFeedbackGenerator(style: .light, view: someView)
```

### Notes
- Rule of thumb: light/soft for small UI elements, medium for standard controls, heavy/rigid for significant or destructive events.
- Never fire notification haptics for passive events the user did not cause — reserve them for outcomes of user-initiated tasks.
- Fire the haptic at the exact moment the visual change happens; even 50 ms of drift feels broken.
