Builds custom tactile and synchronized audio-haptic experiences with Core Haptics, including CHHapticEngine lifecycle, transient and continuous events, dynamic parameters, parameter curves, AHAP files, and device verification. Use when system sensoryFeedback or UIFeedbackGenerator patterns cannot express the required haptic behavior.
89%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Compose, play, and verify custom haptic patterns with CoreHaptics. Scope:
Swift 6.4, iOS 26+, and supported physical hardware.
Use the smallest API that expresses the interaction:
| Need | Owner |
|---|---|
| Standard success, warning, selection, impact, or SwiftUI state feedback | sensoryFeedback or UIKit feedback generators; see swiftui-patterns |
| Custom waveform, sustained feedback, live modulation, or synchronized haptic/audio | This skill and Core Haptics |
| Ordinary audio playback, routing, recording, or audio-session policy | AVFAudio/AVKit guidance, not this skill |
| Controller rumble | Core Haptics controller APIs; keep controller discovery/input in the game-controller owner |
Do not introduce CHHapticEngine for a normal button tap. Custom haptics add lifecycle,
hardware, interruption, power, and physical-device test responsibilities.
CHHapticEngine.capabilitiesForHardware() before creating an engine.stoppedHandler and resetHandler before starting the engine.Load Core Haptics patterns when writing engine ownership, programmatic events, live modulation, parameter curves, or AHAP playback.
Core Haptics is not universally available. Apple specifically lists devices such as iPad, iPod touch, and Apple Vision Pro among devices without haptic feedback support. Check capability at runtime rather than inferring it from platform or model.
import CoreHaptics
struct HapticCapability {
let supportsHaptics: Bool
let supportsAudio: Bool
static var current: Self {
let hardware = CHHapticEngine.capabilitiesForHardware()
return Self(
supportsHaptics: hardware.supportsHaptics,
supportsAudio: hardware.supportsAudio
)
}
}Keep the product action successful when haptics are unavailable. Provide visual or audio confirmation only when it is appropriate; never make haptics the sole carrier of state or error information.
start().stoppedHandler as an external-stop notification. It may run off the main
thread and is not called for an explicit stop(completionHandler:).resetHandler as invalidation of previously prepared engine resources.
Restart the engine and recreate any players or registered audio resources the
feature still needs.isAutoShutdownEnabled and tolerate automatic idle shutdown/restart behavior.Do not assume foregrounding alone repairs an interrupted engine. Recovery belongs in the engine handlers and should be idempotent.
Use CHHapticEvent and CHHapticPattern when timing and values derive from live
application state or the pattern is small. A transient event is a short impulse; a
continuous event has a duration and must be stopped at the interaction boundary.
Use bundled .ahap assets when designers need to tune a reusable sequence without
rewriting Swift. AHAP represents events, dynamic parameters, parameter curves, and
optional synchronized custom audio. Validate the asset in the app bundle and handle
load/play errors rather than silently force-unwrapping its URL.
CHHapticEventParameter defines an event's initial intensity, sharpness, or envelope.CHHapticParameterCurve schedules gradual changes as part of a pattern.CHHapticDynamicParameter changes a running player immediately.Do not confuse event parameter identifiers such as .hapticIntensity with dynamic
control identifiers such as .hapticIntensityControl.
Use makePlayer(with:) for fixed start/stop playback. Use
makeAdvancedPlayer(with:) when the feature needs looping, pause/resume, seeking,
completion callbacks, or reusable granular control.
For a gesture-driven continuous haptic:
Intensity and sharpness are perceptual controls, not a guarantee of identical output across hardware. Tune on every supported device family in scope.
Simulator can compile Core Haptics code but cannot validate the tactile result. Test on supported physical hardware and record:
Compile verification proves API availability only. Product review must assess whether the feedback is distinguishable, proportional, and not fatiguing.
sensoryFeedback already expresses the intent.thienqo/ios-skills
6bf8b62
Also appears in
since Oct 29, 2026
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.