Reorder EKReminder in a list

橙三吉。 提交于 2019-12-07 07:22:03

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/18153843/reorder-ekreminder-in-a-list

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!