Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding an EKAlarm to EKReminder with a recurrence rule

I have a quick question for someone familiar with Event Kit...

I'm creating recurring reminders and I'd like an alarm to sound at each recurrence. However, the documentation suggests I can only create an alarm with an absolute date or a relative offset. Is there any way to get an alarm to fire every time the reminder reoccurs? Does it do this automatically?

Thanks!

like image 957
Sean Danzeiser Avatar asked Nov 04 '22 03:11

Sean Danzeiser


1 Answers

Since EKReminder is a subclass of EKCalendarItem you can use the addRecurrenceRule: method to add a recurrence rule so the reminder repeats. Unfortunately, you can't create a recurring alarm since the relative offset alarm is based on the start date of the reminder, and not the date of each recurring reminder. However, you can add multiple EKAlarm's to your EKReminder object so if your event repeats a discrete number of times, you could add an alarm for each. If it repeats forever, you may be out of luck since Apple's docs say:

Be warned that some calendars can only allow a certain maximum number of alarms. When this item is saved, it will truncate any extra alarms from the array.

like image 172
mpatzer Avatar answered Nov 11 '22 09:11

mpatzer