gpt4 book ai didi

swift - iOS 10 : repeating local user notification from specific date every month

转载 作者:搜寻专家 更新时间:2023-11-01 06:32:35 24 4
gpt4 key购买 nike

通知将在即 25-7-2017 使用:UNCalendarNotificationTrigger(dateMatching: dueDate, repeats: false)

如何每月重复通知,即 25-8-2017、25-9-2017 等等。

最佳答案

不是在初始化触发器时提供完整日期,而是传递一组仅包含月份日期的 DateComponents,并将 repeats 设置为 true

let components = DateComponents(day: 25)
let trigger = UNCalendarNotificationTrigger(dateMatching: components, repeats: true)

关于swift - iOS 10 : repeating local user notification from specific date every month,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45200266/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com