Here's an example of a function that causes the phone to vibrate immediately in Swift:
main.swift115 chars7 linesTo use this function, you can simply call vibratePhone() wherever you want to trigger the vibration.
Note that this function uses the AudioToolbox framework to play the system vibration sound.
gistlibby LogSnag