I know there is the EKEventStoreChanged Event to keep track of changes in the Reminder-App. The only problem is that this event just get triggered, when a list in the reminder app gets created or deleted. Not edited.
Does anyone know how to keep track of editing changes, to update the SwiftUI View?
Thanks
The Observer I added so far:
NotificationCenter.default.addObserver(forName: .EKEventStoreChanged, object: ReminderManager.shared.eventStore, queue: nil) { notification in self.storeChanged(notification) }
In SwiftUI use
onReceivefor notifications, e.g.The docs state you should call
refreshon the reminder and if it returnstrue, refetch it to get the changes and merge them into your edits. If it returnsfalseit wasn't changed so you don't need to refetch it.https://developer.apple.com/documentation/foundation/nsnotification/name/1507525-ekeventstorechanged
More info here
https://developer.apple.com/documentation/eventkit/updating_with_notifications
FYI there is a
EKEventViewControllerthat you could wrap in aUIViewControllerRepresentable, here is an example:https://nemecek.be/blog/40/how-to-use-ekeventeditviewcontroller-in-swiftui#complete-code
(Note you will need to fix the
Coordinator(self)mistake,selfwill go out of date the next time this struct is init.