Last active
August 15, 2017 04:58
-
-
Save saoudrizwan/d390611f9a283dacea7fc975eb1754d2 to your computer and use it in GitHub Desktop.
Basic vibration example for 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 | |
| // kSystemSoundID_Vibrate is just a UInt32 with a value of 4095 | |
| let vibrate = SystemSoundID(kSystemSoundID_Vibrate) | |
| AudioServicesPlaySystemSound(vibrate) | |
| // ... or if you want a completion block to be called after the vibration finishes | |
| let vibrate = SystemSoundID(kSystemSoundID_Vibrate) // 4095 | |
| AudioServicesPlaySystemSoundWithCompletion(vibrate, { | |
| print("did vibrate") | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment