Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reorder EKReminder in a list

Tags:

ios

eventkit

Is it possible to reorder EKReminders in EKCalendar of type reminders? In native Reminders app it is possible, but I can't seem to find this option in the API.

like image 754
Eli_Rozen Avatar asked Oct 22 '22 03:10

Eli_Rozen


1 Answers

So, EKCalendarItem objects have calendarItemExternalIdentifier which is unique to the event across devices. You can use this to your advantage for this ordering strategy.

Every time you fetch events from the calendar API, keep track of their calendarItemExternalIdentifier in whatever persistence store you choose (Core Data, SQLite, Property Lists, etc...) and also keep track of it's order.

So if you used Core Data you might have an entity with two attributes, calendarItemExternalIdentifier and order. Now whenever you present the events to the user, query the persistent store for order of each event and display accordingly. If new events come in, find the highest order and increment from there. When the user re-orders, set the order key for the appropriate record in your persistent store.

like image 136
Chris Wagner Avatar answered Nov 03 '22 19:11

Chris Wagner