Last active
January 31, 2018 14:44
-
-
Save asus4/9664093 to your computer and use it in GitHub Desktop.
Less than one second vibration 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
double length = 0.1; | |
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); | |
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(length * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | |
// private method | |
AudioServicesStopSystemSound(kSystemSoundID_Vibrate); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this is exactly what I was looking for. However does this code pass iTunes review?