UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

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?

3      

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.

4      

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.

3      

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.

4      

TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!

Find out more

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

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

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.