Ios 快速播放警报声
我有一个警报,当用户用完时间时会弹出。现在它只是震动,但我也希望它能发出警报声。是否有办法播放用户设置为系统默认报警声的任何内容?此外,在用户单击“解除”按钮之前,是否可以让警报一直持续 以下是我目前的代码:Ios 快速播放警报声,ios,swift,audio,alarm,uialertcontroller,Ios,Swift,Audio,Alarm,Uialertcontroller,我有一个警报,当用户用完时间时会弹出。现在它只是震动,但我也希望它能发出警报声。是否有办法播放用户设置为系统默认报警声的任何内容?此外,在用户单击“解除”按钮之前,是否可以让警报一直持续 以下是我目前的代码: func dismissAlert(alert:UIAlertAction!) { self.dismissViewControllerAnimated(true, completion: nil) } let outOfTimeA
func dismissAlert(alert:UIAlertAction!)
{
self.dismissViewControllerAnimated(true, completion: nil)
}
let outOfTimeAlert = UIAlertController(title: "Out Of Time", message: "Better luck next time", preferredStyle: UIAlertControllerStyle.Alert)
let cancelAlert: UIAlertAction = UIAlertAction(title: "Dismiss", style: .Cancel, handler: dismissAlert)
outOfTimeAlert.addAction(cancelAlert)
presentViewController(outOfTimeAlert, animated: true, completion: nil)
AudioServicesPlayAlertSound(kSystemSoundID_Vibrate)
谢谢你的帮助