我可以自定义 UILocalNotification 重复间隔(即仅限工作日吗?)

发布于 2024-10-01 06:01:53 字数 156 浏览 0 评论 0原文

我希望能够安排 UILocalNotification 在每天的同一时间重复,但仅限于工作日(没有周六或周日)。使用 UILocalNotification 的重复间隔功能是否可以实现这一点,或者是我创建某种处理时间和日期并计算出何时提前安排(多个)通知的类的唯一选择?

提前致谢。

I would like to be able to schedule a UILocalNotification to repeat at the same time every day, but only on weekdays (no Saturdays or Sundays). Is this possible using the repeat interval feature of UILocalNotification, or is my only option to create some kind of class that handles the time and date and works out when to schedule (several) notifications in advance?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

狼性发作 2024-10-08 06:01:53

是的,这是可能的。将 UILocalNotification 的 repeatInterval 设置为 NSWeekdayCalendarUnit

这是 可用的repeatIntervals列表。

Yes, this is possible. Set the repeatInterval of the UILocalNotication to NSWeekdayCalendarUnit.

Here's a list of available repeatIntervals.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文