我是一名新开发人员,想知道如何silent/vibrate
通过代码(swift2
)来开发 IOS 设备,我不在乎它是否需要私有API。请帮忙。
问问题
1223 次
1 回答
0
您需要导入系统声音服务
import AudioToolbox.AudioServices
然后就可以播放振动提示“声音”了
AudioServicesPlayAlertSound(SystemSoundID(kSystemSoundID_Vibrate))
更多信息可以在 Apple 文档中找到: https ://developer.apple.com/library/prerelease/ios/documentation/AudioToolbox/Reference/SystemSoundServicesReference/index.html
于 2016-01-19T07:27:41.780 回答