Last active
June 9, 2024 02:36
-
-
Save saoudrizwan/82505bad682289baf077ad02ccb15177 to your computer and use it in GitHub Desktop.
Example of using Taptic Engine haptic signals on iOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import AudioToolbox.AudioServices | |
// 'Peek' feedback (weak boom) | |
let peek = SystemSoundID(1519) | |
AudioServicesPlaySystemSound(peek) | |
// 'Pop' feedback (strong boom) | |
let pop = SystemSoundID(1520) | |
AudioServicesPlaySystemSound(pop) | |
// 'Cancelled' feedback (three sequential weak booms) | |
let cancelled = SystemSoundID(1521) | |
AudioServicesPlaySystemSound(cancelled) | |
// 'Try Again' feedback (week boom then strong boom) | |
let tryAgain = SystemSoundID(1102) | |
AudioServicesPlaySystemSound(tryAgain) | |
// 'Failed' feedback (three sequential strong booms) | |
let failed = SystemSoundID(1107) | |
AudioServicesPlaySystemSound(failed) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment