我正在使用app,用户可以为每日本地通知设置时间,然后我可以选择启用或禁用这些通知.我的问题如何禁用/取消已设置的通知?
在其中一个IF我需要取消通知
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if (indexPath as NSIndexPath).row == 1 && switchiBtn.isOn == false {
return 0.0
}
if (indexPath as NSIndexPath).row == 2 {
if switchiBtn.isOn == false || dpVisible == true {
return 0.0
}
return 216.0
}
if (indexPath as NSIndexPath).row == 3 {
if switchiBtn.isOn == false || dpVisible == true {
return 0.0
}
return 44
}
return 50.0
}
Run Code Online (Sandbox Code Playgroud)
以下是日程安排和按钮的功能,我在这里设置通知.
func scheduleNotif(date: DateComponents, completion: @escaping …Run Code Online (Sandbox Code Playgroud)