Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invoking and controlling vibration using Swift and iOS8

How can I invoke vibration using Swift and control its duration? Also what other parameters can be defined? I would like to invoke a very short vibration using Swift.

I tried the following function:

func () {
  AudioServicesPlaySystemSound(kSystemSoundID_Vibrate)
}

but I get this error:

'Int' is not convertible to 'SystemSoundID'
like image 462
DanteDeveloper Avatar asked Sep 02 '14 19:09

DanteDeveloper


1 Answers

This would be a better solution:

AudioServicesPlayAlertSound(SystemSoundID(kSystemSoundID_Vibrate))

like image 142
Mark Avatar answered Oct 18 '22 07:10

Mark