- 导入AudioToolbox.framework包
- 在swift文件中
import AudioToolbox
-
AudioServicesPlaySystemSound(SystemSoundID.convertFromIntegerLiteral(UInt32(kSystemSoundID_Vibrate)))
import AudioToolbox
AudioServicesPlaySystemSound(SystemSoundID.convertFromIntegerLiteral(UInt32(kSystemSoundID_Vibrate)))