EventKit 更新を検知
Calendar/Reminder に更新があったら検知して更新するというもの。
簡単すぎ
swift
for await _ in center.notifications(named: .EKEventStoreChanged) {
print("--> calenar updated")
await MainActor.run {
// 読み直す処理
}
}
参考:Warning を黙らせるにはこうする必要があるみたい
swift
for await _ in center.notifications(named: .EKEventStoreChanged).map({ $0.name }) {
print("--> calenar updated")
await MainActor.run {
// 読み直す処理
}
}