gpt4 book ai didi

ios - 如何设置每周重复一次的 EKRecurrenceRule 规则

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

我怎样才能最好地快速创建一个 EKRecurrenceRule 以允许每周安排一次事件,可能一周几天。

例如,每周每周五和周六都会发生一个新事件。

    var dayOfWeek = [EKWeekday.Friday, EKWeekday.Saturday]

EKRecurrenceRule(recurrenceWithFrequency: EKRecurrenceFrequency.Weekly, interval: 1, daysOfTheWeek: dayOfWeek)

目前上面的不行

如何制定?

(swift 的示例和教程很少)

最佳答案

应该这样做:

let friday = EKRecurrenceDayOfWeek(.Friday)
let saturday = EKRecurrenceDayOfWeek(.Saturday)

EKRecurrenceRule(recurrenceWithFrequency: .Weekly, interval: 1, daysOfTheWeek: [friday, saturday], daysOfTheMonth: nil, monthsOfTheYear: nil, weeksOfTheYear: nil, daysOfTheYear: nil, setPositions: nil, end: nil)

关于ios - 如何设置每周重复一次的 EKRecurrenceRule 规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37515119/

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