Created
April 26, 2015 13:55
-
-
Save Air-Craft/cd95f99245294206652a to your computer and use it in GitHub Desktop.
Short custom vibration on iPhone #ios #vibration #private-api
This file contains 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
// Headers | |
#import <AudioToolbox/AudioToolbox.h> | |
void AudioServicesStopSystemSound(SystemSoundID inSystemSoundID); | |
void AudioServicesPlaySystemSoundWithVibration(SystemSoundID inSystemSoundID,id arg,NSDictionary* vibratePattern); | |
// Buzz code | |
NSArray *vibe = @[ @YES, @10 ]; // ON for 10ms | |
NSDictionary *dict = @{ @"Intensity": @0.1, @"VibePattern": vibe }; | |
AudioServicesPlaySystemSoundWithVibration(kSystemSoundID_Vibrate,nil,dict); | |
// [self bk_performBlock:^(id obj) { | |
// AudioServicesStopSystemSound(kSystemSoundID_Vibrate); | |
// } afterDelay:1]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment