How to add some additional fields to EKEvent

那年仲夏 提交于 2020-01-14 14:32:14

问题


One solution could be:

Creating a new model EKEventExt and add a One-to-One relationship between them, I'm not sure whether it's doable, since EKEventExt is stored in my one sqlite and EKEvent is stored in eventstore.


回答1:


It would be possible to append custom fields to calendar formats such as iCal (like x-my-field), there is no EKEvent property like .customFields etc. Saying this, unfortunately it's not possible to store your custom data in any fields. It would be possible to create your own iCal file and then specify your custom fields, but they will get lost really quick.

I suggest you use your data, convert it to strings or an identfier and store it in the URL or the Notes field. This ensures, your data will be transferred into the calendar and synced anywhere. If you want the user to be unable to read your custom data, use a base64 version of the string. This is how I'm doing it and it works quite well.

To answer your upcoming question: No, unfortunately it's not possible to make one of those fields read-only...



来源:https://stackoverflow.com/questions/32550287/how-to-add-some-additional-fields-to-ekevent

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