Skip to content

Instantly share code, notes, and snippets.

View emaalouf's full-sized avatar
😀
Working on several projects at once

Elias Maalouf emaalouf

😀
Working on several projects at once
  • Beirut,Lebanon
  • 14:41 (UTC +02:00)
  • X @emaalouf
View GitHub Profile
@emaalouf
emaalouf / iphone_vibrate.m
Created June 4, 2016 16:22 — forked from Air-Craft/iphone_vibrate.m
Short custom vibration on iPhone #ios #vibration #private-api
// 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);