<!--
{
  "documentType" : "article",
  "framework" : "EventKit",
  "identifier" : "/documentation/EventKit/updating-with-notifications",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Updating with notifications"
}
-->

# Updating with notifications

Register for notifications about changes and keep your app up to date.

## Discussion

It’s possible for another process or app to modify the Calendar database while your app is running. If your app fetches calendar events or reminders, register to be notified about changes to the Calendar database to ensure the calendar and reminder information you display to the user is current.

### Register for Notifications

An [`EKEventStore`](/documentation/EventKit/EKEventStore) object posts an [`EKEventStoreChangedNotification`](/documentation/EventKit/EKEventStoreChangedNotification) notification whenever it detects changes to the Calendar database. Register for this notification if your app handles event or reminder data.

The code listing below registers for the [`EKEventStoreChangedNotification`](/documentation/EventKit/EKEventStoreChangedNotification) notification.

```swift
NotificationCenter.default.addObserver(self, selector: Selector("storeChanged:"), name: .EKEventStoreChanged, object: eventStore)
```

### Respond to Notifications

When you receive an [`EKEventStoreChangedNotification`](/documentation/EventKit/EKEventStoreChangedNotification) notification, it’s possible the objects you’ve fetched—such as an [`EKEvent`](/documentation/EventKit/EKEvent), [`EKReminder`](/documentation/EventKit/EKReminder), or [`EKCalendar`](/documentation/EventKit/EKCalendar)—have changed. The effect of the changes depends on whether an event was added, modified, or deleted:

- If an event was added, it does not affect any of your previously fetched events or reminders, but the added event may fall within the date range of events you are displaying to the user.
- If an event was modified or deleted, properties of ``doc://com.apple.eventkit/documentation/EventKit/EKEvent`` and ``doc://com.apple.eventkit/documentation/EventKit/EKReminder`` objects representing that event may become out of date.

Because your local data is often invalidated or incomplete when a change occurs in the Calendar database, you should refetch your current date range of events whenever you receive an [`EKEventStoreChangedNotification`](/documentation/EventKit/EKEventStoreChangedNotification) notification. If you are modifying an event and do not want to refetch it unless it is absolutely necessary, call the [`refreshSourcesIfNecessary()`](/documentation/EventKit/EKEventStore/refreshSourcesIfNecessary()) method on the event. If the method returns `YES`, you can continue to use the event; otherwise, you must refetch it. 

> Note:
> Events being modified in an event view controller with EventKitUI for iOS are updated automatically when a change occurs in the Calendar database. See <doc://com.apple.documentation/documentation/EventKitUI> for more.

## Topics

### Receiving a Notification

[`EKEventStoreChangedNotification`](/documentation/EventKit/EKEventStoreChangedNotification)

A notification posted when changes are made to the Calendar database.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)
