Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vibrate iPhone for specified duration

I would like to be able to vibrate the iPhone for a specified duration. Using the AudioToolbox framework, it will vibrate for about 2 seconds, when I use this code:

AudioServicesPlaySystemSound (kSystemSoundID_Vibrate);

This does the job, but I'd rather vibrate for a shorter (or longer) duration depending on how the user performed the action, not to mention the benefits this could offer to game developers.

Thanks for any ideas.

like image 213
Tristan Avatar asked Nov 14 '22 02:11

Tristan


1 Answers

You could set a NSTimer or a for loop that would set off a vibration every two seconds and make it seem like a long vibrate. Not sure if Apple would allow this tough.

like image 173
tomislav Avatar answered Jan 21 '23 11:01

tomislav