Haptics

Haptic feedback: UIImpactFeedbackGenerator, UINotificationFeedbackGenerator, CoreHaptics custom patterns. Use when implementing app features related to haptics.

abdullah4ai 7bcb6a8 681 B Updated

File contents

Haptics

HAPTIC FEEDBACK:

  • UIImpactFeedbackGenerator(style: .medium).impactOccurred() for simple taps
  • UINotificationFeedbackGenerator().notificationOccurred(.success/.warning/.error) for outcomes
  • UISelectionFeedbackGenerator().selectionChanged() for selection changes
  • CoreHaptics for custom patterns: CHHapticEngine + CHHapticEvent
  • Always check CHHapticEngine.capabilitiesForHardware().supportsHaptics
  • Prepare generator before use: generator.prepare() for lower latency

abdullah4ai/apple-dev-docs/tree/main/swiftship/internal/skills/data/features/haptics commit 7bcb6a877f

Frequently asked questions

npx skillmds@latest add abdullah4ai/haptics-2