返回 Skill 列表
extension
分类: 开发与工程无需 API Key

"haptics"

触觉反馈:UIImpactFeedbackGenerator,UINotificationFeedbackGenerator,CoreHaptics自定义模式。在实现与触觉相关的应用程序功能时使用。

person作者: jakexiaohubgithub

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