Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add some additional fields to EKEvent

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.

like image 423
Yuwen Yan Avatar asked Mar 15 '23 19:03

Yuwen Yan


1 Answers

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...

like image 51
emmics Avatar answered Mar 28 '23 20:03

emmics