-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refresh events when app is reopened/brought to foreground #7
Comments
Hi, happy this repo was useful to you. I will add the update example :-) |
Turns out, there is EventKit notification for this purpose :-) Let me know if it works as expected |
Fantastic, thank you! I haven't had the time to test it yet. Just a thought though, are the changes also applicable to the SwiftUI version of your example? |
Yes, I think it should work roughly in the same way. Subscribe to the EventKit notification and when you get it, reload all the events. |
I gave it a try (or more like 50) but I can't seem to get it to work. And to be honest, this is way above my competence level. Would you mind updating the SwiftUI example as well? I would really appreciate it! Thanks! |
I can certainly try, but I am not really proficient with SwiftUI |
That would be great! I came across this when searching for some examples: https://developer.apple.com/documentation/foundation/nsnotification/name/1507525-ekeventstorechanged |
Yes, that is what I used in UIKit version and now moved to SwiftUI. Although the whole SwiftUI version looks kind of broken right now after the iOS 14 update.. it should still work though |
Ah, I see! Anyway, many thanks! I will give it a try and get back to you. |
Closing for inactivity. Feel free to open fresh issue. Thanks. |
Oh, sorry for not getting back to you, totally forgot about it. Anyway, your change works great! Good work! |
No problem! Glad it works :-) |
I'm fairly new to Swift and I've been using some of your EKEventKit examples (great work!) in a small project of mine. I've noticed one thing though. If you exit the app and make some changes to an event in the calendar app (like changing the name), the events fetched by your example are not updated. I can get the events to update by force closing the app or by reselecting the calendar(s).
Would it be possible to extend the example so it also updates the events when the app re-opened/brought back to foreground? Maybe by e.g. .willEnterForegroundNotification, or some other solution?
The text was updated successfully, but these errors were encountered: