EKRecurrenceRule with end repeat never

2019-04-14 19:59发布

I want to create a EKEvent in calendar with forever repeat option. Below is the code for the Recurrence rule

  EKRecurrenceRule *rule = [[EKRecurrenceRule alloc] 
                            initRecurrenceWithFrequency:EKRecurrenceFrequencyDaily 
                            interval:1
                            end:[EKRecurrenceEnd recurrenceEndWithEndDate:date]];

how to set infinite or never end in recurrence end argument.

Thanks

2条回答
相关推荐>>
2楼-- · 2019-04-14 20:17
EKRecurrenceRule *rule = [[EKRecurrenceRule alloc] 
                        initRecurrenceWithFrequency:EKRecurrenceFrequencyDaily 
                        interval:1
                        end:nil];

just pass nil to the end so that it repeats all over. Have a happy Coding.

查看更多
叼着烟拽天下
3楼-- · 2019-04-14 20:26

little late, but i 'll answer, because i could not find the answer anywhere in the Apple Doc. Just pass nil as end param and there you go. Calender sets the end of the event to infinite.

EKRecurrenceRule *rule = [[EKRecurrenceRule alloc] 
                        initRecurrenceWithFrequency:EKRecurrenceFrequencyDaily 
                        interval:1
                        end:[EKRecurrenceEnd recurrenceEndWithEndDate:nil]];

The calender creates recurrence events for 2 years and then adds them on demand.

greets

查看更多
登录 后发表回答