Skip to content

Instantly share code, notes, and snippets.

@asus4
Last active January 31, 2018 14:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save asus4/9664093 to your computer and use it in GitHub Desktop.
Save asus4/9664093 to your computer and use it in GitHub Desktop.
Less than one second vibration for iOS
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);
});
@sbiefeni
Copy link

this is exactly what I was looking for. However does this code pass iTunes review?

@sbiefeni
Copy link

No it doesn't...:-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment