是否有API将Apple的Clock应用程序中的计时器设置为特定的倒计时?
我知道有Reminders SDK和EventKit,但我一直在寻找设置计时器而不是提醒。
不,没有可用的API。您应该在应用程序内创建自定义计时器以复制该功能。
使用Timer类的Foundation在您的应用程序中创建一个简单的计时器。
let timer: Timer! timer = Timer.scheduledTimer(withTimeInterval: 60, repeats: false) { timer in [completion code] }
有关使用倒计时创建计时器的更多信息,请查看this question。