Custom vibration in iOS 8 - Swift

I am writing a sprite-based sprite application quickly and need a short tactile feedback using vibration

so first i imported AudioToolbox and used this

AudioServicesPlayAlertSound(SystemSoundID(kSystemSoundID_Vibrate)) 

and it worked well, but it vibrates too long, and there is no way to control this duration.

Then after some searching, I read Kevin Cao:

Is there an API for custom vibrations in iOS?

but unfortunately, the private AudioServicesPlaySystemSoundWithVibration function was only available in iOS 6.

Is there another way?

+7
ios8 swift vibration
source share
1 answer

You need the AudioServicesPlaySystemSoundWithVibration API. But, unfortunately, this is personal, and you can not publish your application :(

Mark this blog post and this answer

+2
source share

All Articles