NEW: Learn to build the incredible iOS 15 Weather app today! >>

SOLVED: Suggestions for identifying Calendar entries

Forums > iOS

Dear all,

do you have any suggestions how to identify a Calendar entry?

Use Case: My app should be able to add/edit entries in the Calendar app. I have no problems in adding them, my problem is how to safely remove/edit them. I need some unique identifier which my users can't edit. I digged through the documentation https://developer.apple.com/documentation/eventkit/ekevent and my understanding is that I can't set the eventIdentifier myself. Also, there is no userinfo dictionary where I can write my own data.

So do you have suggestions how I can manage to delete/edit a specific entry I have created with my app?

   

Hi, but you don't need to set eventIdentifier to use it right? What about saving the EKEvent and then inspecting its identifier and saving it? This way you can query the event details later.

1      

Hi, no, I don't. But the developer documentation says that this identifier could change when Calendar is changed at a later date. I am unsure if this is reliable. But I give it a try. Thank you.

   

Yea, I have seen this disclaimer for EKCalendar also but in my testing, this wasn't an issue yet. It would be nice to have more robust way but this appears to be the best we got.

1      

Hacking with Swift is sponsored by Sentry

SPONSORED With Sentry’s error and performance monitoring for iOS, you see mobile vitals that actually matter, can solve any latency issues quickly, and learn how each release is performing over time.

Learn More

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.