如何设置每周重复一次的 EKRecurrenceRule 规则
How to setup EKRecurrenceRule rule for repeating once a week
我怎样才能最好地在 swift 中创建一个 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)
我怎样才能最好地在 swift 中创建一个 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)