I'm a new developer and would like to know how to silent/vibrate
an IOS device through code(swift2
), I don't care if it requires a private API. Please help.
Asked
Active
Viewed 1,228 times
0

Unus Yousuf
- 37
- 4
1 Answers
0
You'll need to import the System Sound Services
import AudioToolbox.AudioServices
Then you can play the vibration alert "sound"
AudioServicesPlayAlertSound(SystemSoundID(kSystemSoundID_Vibrate))
More information can be found in the Apple docs: https://developer.apple.com/library/prerelease/ios/documentation/AudioToolbox/Reference/SystemSoundServicesReference/index.html

Adolfo
- 4,969
- 4
- 26
- 28