Create, read, and manage calendar events and reminders using EventKit and EventKitUI. Use when adding events to the user's calendar, creating reminders,…
EventKit — Calendar & Reminders
Create, read, and manage calendar events and reminders. Covers authorization,
event and reminder CRUD, recurrence rules, alarms, and EventKitUI editors.
Targets Swift 6.2 / iOS 26+.
Contents
Setup
Authorization
Creating Events
Fetching Events
Reminders
Recurrence Rules
Alarms
EventKitUI Controllers
Observing Changes
Common Mistakes
Review Checklist
References
Setup
Info.plist Keys
Add the required usage description strings based on what access level you need:
Key
Access Level
NSCalendarsFullAccessUsageDescription
Read + write events
NSCalendarsWriteOnlyAccessUsageDescription
Write-only events (iOS 17+)
NSRemindersFullAccessUsageDescription
Read + write reminders
For apps also targeting iOS 16 or earlier, also include the legacy NSCalendarsUsageDescription / NSRemindersUsageDescription keys.
Event Store
Create a single EKEventStore instance and reuse it. Do not mix objects from
different event stores.
import EventKit
let eventStore = EKEventStore()
Authorization
iOS 17+ introduced granular access levels. Use the modern async methods.
Full Access to Events
func requestCalendarAccess() async throws -> Bool {
let granted = try await eventStore.requestFullAccessToEvents()
return granted
}
Write-Only Access to Events
Use when your app only creates events (e.g., saving a booking) and does not
need to read existing events.
func requestWriteAccess() async throws -> Bool {
let granted = try await eventStore.requestWriteOnlyAccessToEvents()
return granted
}
Full Access to Reminders
func requestRemindersAccess() async throws -> Bool {
let granted = try await eventStore.requestFullAccessToReminders()
return granted
}
Checking Authorization Status
let status = EKEventStore.authorizationStatus(for: .event)
switch status {
case .notDetermined:
// Request access
break
case .fullAccess:
// Read and write allowed
break
case .writeOnly:
// Write-only access granted (iOS 17+)
break
case .restricted:
// Parental controls or MDM restriction
break
case .denied:
// User denied -- direct to Settings
break
@unknown default:
break
}
Creating Events
func createEvent(
title: String,
startDate: Date,
endDate: Date,
calendar: EKCalendar? = nil
) throws {
let event = EKEvent(eventStore: eventStore)
event.title = title
event.startDate = startDate
event.endDate = endDate
event.calendar = calendar ?? eventStore.defaultCalendarForNewEvents
try eventStore.save(event, span: .thisEvent)
}
Setting a Specific Calendar
// List writable calendars
let calendars = eventStore.calendars(for: .event)
.filter { $0.allowsContentModifications }
// Use the first writable calendar, or the default
let targetCalendar = calendars.first ?? eventStore.defaultCalendarForNewEvents
event.calendar = targetCalendar
Adding Structured Location
import CoreLocation
let location = EKStructuredLocation(title: "Apple Park")
location.geoLocation = CLLocation(latitude: 37.3349, longitude: -122.0090)
event.structuredLocation = location
Fetching Events
Use a date-range predicate to query events. The events(matching:) method
returns occurrences of recurring events expanded within the range.
func fetchEvents(from start: Date, to end: Date) -> [EKEvent] {
let predicate = eventStore.predicateForEvents(
withStart: start,
end: end,
calendars: nil // nil = all calendars
)
return eventStore.events(matching: predicate)
.sorted { $0.startDate < $1.startDate }
}
Fetching a Single Event by Identifier
if let event = eventStore.event(withIdentifier: savedEventID) {
print(event.title ?? "No title")
}
Reminders
Creating a Reminder
func createReminder(title: String, dueDate: Date) throws {
let reminder = EKReminder(eventStore: eventStore)
reminder.title = title
reminder.calendar = eventStore.defaultCalendarForNewReminders()
let dueDateComponents = Calendar.current.dateComponents(
[.year, .month, .day, .hour, .minute],
from: dueDate
)
reminder.dueDateComponents = dueDateComponents
try eventStore.save(reminder, commit: true)
}
Fetching Reminders
Reminder fetches are asynchronous and return through a completion handler.
func fetchIncompleteReminders() async -> [EKReminder] {
let predicate = eventStore.predicateForIncompleteReminders(
withDueDateStarting: nil,
ending: nil,
calendars: nil
)
return await withCheckedContinuation { continuation in
eventStore.fetchReminders(matching: predicate) { reminders in
continuation.resume(returning: reminders ?? [])
}
}
}
Completing a Reminder
func completeReminder(_ reminder: EKReminder) throws {
reminder.isCompleted = true
try eventStore.save(reminder, commit: true)
}
Recurrence Rules
Use EKRecurrenceRule to create repeating events or reminders.
Simple Recurrence
// Every week, indefinitely
let weeklyRule = EKRecurrenceRule(
recurrenceWith: .weekly,
interval: 1,
end: nil
)
event.addRecurrenceRule(weeklyRule)
// Every 2 weeks, ending after 10 occurrences
let biweeklyRule = EKRecurrenceRule(
recurrenceWith: .weekly,
interval: 2,
end: EKRecurrenceEnd(occurrenceCount: 10)
)
// Monthly, ending on a specific date
let monthlyRule = EKRecurrenceRule(
recurrenceWith: .monthly,
interval: 1,
end: EKRecurrenceEnd(end: endDate)
)
Complex Recurrence
// Every Monday and Wednesday
let days = [
EKRecurrenceDayOfWeek(.monday),
EKRecurrenceDayOfWeek(.wednesday)
]
let complexRule = EKRecurrenceRule(
recurrenceWith: .weekly,
interval: 1,
daysOfTheWeek: days,
daysOfTheMonth: nil,
monthsOfTheYear: nil,
weeksOfTheYear: nil,
daysOfTheYear: nil,
setPositions: nil,
end: nil
)
event.addRecurrenceRule(complexRule)
Editing Recurring Events
When saving changes to a recurring event, specify the span:
// Change only this occurrence
try eventStore.save(event, span: .thisEvent)
// Change this and all future occurrences
try eventStore.save(event, span: .futureEvents)
Alarms
Attach alarms to events or reminders to trigger notifications.
// 15 minutes before
let alarm = EKAlarm(relativeOffset: -15 * 60)
event.addAlarm(alarm)
// At an absolute date
let absoluteAlarm = EKAlarm(absoluteDate: alertDate)
event.addAlarm(absoluteAlarm)
EventKitUI Controllers
EKEventEditViewController — Create/Edit Events
Present the system event editor for creating or editing events.
import EventKitUI
class EventEditorCoordinator: NSObject, EKEventEditViewDelegate {
let eventStore = EKEventStore()
func presentEditor(from viewController: UIViewController) {
let editor = EKEventEditViewController()
editor.eventStore = eventStore
editor.editViewDelegate = self
viewController.present(editor, animated: true)
}
func eventEditViewController(
_ controller: EKEventEditViewController,
didCompleteWith action: EKEventEditViewAction
) {
switch action {
case .saved:
// Event saved
break
case .canceled:
break
case .deleted:
break
@unknown default:
break
}
controller.dismiss(animated: true)
}
}
EKEventViewController — View an Event
import EventKitUI
let viewer = EKEventViewController()
viewer.event = existingEvent
viewer.allowsEditing = true
navigationController?.pushViewController(viewer, animated: true)
EKCalendarChooser — Select Calendars
let chooser = EKCalendarChooser(
selectionStyle: .multiple,
displayStyle: .allCalendars,
entityType: .event,
eventStore: eventStore
)
chooser.showsDoneButton = true
chooser.showsCancelButton = true
chooser.delegate = self
present(UINavigationController(rootViewController: chooser), animated: true)
Observing Changes
Register for EKEventStoreChanged notifications to keep your UI in sync when
events are modified outside your app (e.g., by the Calendar app or a sync).
NotificationCenter.default.addObserver(
forName: .EKEventStoreChanged,
object: eventStore,
queue: .main
) { [weak self] _ in
self?.refreshEvents()
}
Always re-fetch events after receiving this notification. Previously fetched
EKEvent objects may be stale.
Common Mistakes
DON'T: Use the deprecated requestAccess(to:) method
// WRONG: Deprecated in iOS 17
eventStore.requestAccess(to: .event) { granted, error in }
// CORRECT: Use the granular async methods
let granted = try await eventStore.requestFullAccessToEvents()
DON'T: Save events to a read-only calendar
// WRONG: No check -- will throw if calendar is read-only
event.calendar = someCalendar
try eventStore.save(event, span: .thisEvent)
// CORRECT: Verify the calendar allows modifications
guard someCalendar.allowsContentModifications else {
event.calendar = eventStore.defaultCalendarForNewEvents
return
}
event.calendar = someCalendar
try eventStore.save(event, span: .thisEvent)
DON'T: Ignore timezone when creating events
// WRONG: Event appears at wrong time for traveling users
event.startDate = Date()
event.endDate = Date().addingTimeInterval(3600)
// CORRECT: Set the timezone explicitly for location-specific events
event.timeZone = TimeZone(identifier: "America/New_York")
event.startDate = startDate
event.endDate = endDate
DON'T: Forget to commit batched saves
// WRONG: Changes never persisted
try eventStore.save(event1, span: .thisEvent, commit: false)
try eventStore.save(event2, span: .thisEvent, commit: false)
// Missing commit!
// CORRECT: Commit after batching
try eventStore.save(event1, span: .thisEvent, commit: false)
try eventStore.save(event2, span: .thisEvent, commit: false)
try eventStore.commit()
DON'T: Mix EKObjects from different event stores
// WRONG: Event fetched from storeA, saved to storeB
let event = storeA.event(withIdentifier: id)!
try storeB.save(event, span: .thisEvent) // Undefined behavior
// CORRECT: Use the same store throughout
let event = eventStore.event(withIdentifier: id)!
try eventStore.save(event, span: .thisEvent)
Review Checklist
Correct Info.plist usage description keys added for calendars and/or reminders
Authorization requested with iOS 17+ granular methods (requestFullAccessToEvents, requestWriteOnlyAccessToEvents, requestFullAccessToReminders)
Authorization status checked before fetching or saving
Single EKEventStore instance reused across the app
Events saved to a writable calendar (allowsContentModifications checked)
Recurring event saves specify correct EKSpan (.thisEvent vs .futureEvents)
Batched saves followed by explicit commit()
EKEventStoreChanged notification observed to refresh stale data
Timezone set explicitly for location-specific events
EKObjects not shared across different event store instances
EventKitUI delegates dismiss controllers in completion callbacks
References
Extended patterns (SwiftUI wrappers, predicate queries, batch operations): references/eventkit-patterns.md
EventKit framework
EKEventStore
EKEvent
EKReminder
EKRecurrenceRule
EKCalendar
EventKit UI
EKEventEditViewController
EKCalendarChooser
Accessing the event store
Creating a recurring event
1d:["$don't have the plugin yet? install it then click "run inline in claude" again.
restructured original reference material into implexa six-component format, made authorization decision logic explicit, added edge cases for read-only calendars/auth expiry/network timeouts, documented all inputs including plist keys and timezone handling, and clarified outcomes with specific calendar app behavior signals.
use this skill to build calendar and reminder functionality into iOS apps. covers the full eventkit api: requesting granular calendar/reminder permissions, creating and fetching events, setting up recurring events with complex rules, attaching alarms, and presenting native apple ui editors. targets swift 6.2 / ios 17+. use when adding events to the user's calendar, creating reminders, editing recurring patterns, or presenting calendar pickers.
NSCalendarsFullAccessUsageDescription: read + write eventsNSCalendarsWriteOnlyAccessUsageDescription: write-only events (ios 17+)NSRemindersFullAccessUsageDescription: read + write remindersNSCalendarsUsageDescription / NSRemindersUsageDescription: legacy fallback for ios 16 and earlierEKEventStore() instance at app launch or in your root view controllerEKEventStore objectlet granted = try await eventStore.requestFullAccessToEvents() for read + writelet granted = try await eventStore.requestWriteOnlyAccessToEvents() for write-only (ios 17+ only)let granted = try await eventStore.requestFullAccessToReminders() for remindersEKEventStore.authorizationStatus(for: .event) or EKEventStore.authorizationStatus(for: .reminder)EKEvent(eventStore: eventStore)calendar.allowsContentModifications is true; fallback to eventStore.defaultCalendarForNewEventsevent.timeZone = TimeZone(identifier: "America/New_York")try eventStore.save(event, span: .thisEvent) to persistlet predicate = eventStore.predicateForEvents(withStart: startDate, end: endDate, calendars: nil)eventStore.events(matching: predicate) to get all occurrences in the range (recurring events are expanded)eventStore.event(withIdentifier: eventID)EKReminder(eventStore: eventStore)reminder.calendar = eventStore.defaultCalendarForNewReminders()Calendar.current.dateComponents([.year, .month, .day, .hour, .minute], from: dueDate)reminder.dueDateComponentstry eventStore.save(reminder, commit: true) to persistlet predicate = eventStore.predicateForIncompleteReminders(withDueDateStarting: nil, ending: nil, calendars: nil)eventStore.fetchReminders(matching:) with a completion handler or wrap in withCheckedContinuation for async/awaitreminder.isCompleted = truetry eventStore.save(reminder, commit: true)EKRecurrenceRule(recurrenceWith: .weekly, interval: 1, end: nil) for weekly indefinitelyEKRecurrenceEnd(occurrenceCount: 10) to end after N occurrencesEKRecurrenceEnd(end: endDate) to end on a specific dateevent.addRecurrenceRule(rule) or reminder.addRecurrenceRule(rule)EKRecurrenceDayOfWeek objects: [EKRecurrenceDayOfWeek(.monday), EKRecurrenceDayOfWeek(.wednesday)]EKRecurrenceRule(recurrenceWith: .weekly, interval: 1, daysOfTheWeek: days, ...other params: nil, end: nil)event.addRecurrenceRule(rule).thisEvent (this occurrence only), .futureEvents (this and all future), or .allEvents (all in series, if supported)try eventStore.save(event, span: .thisEvent) or .futureEventsEKAlarm(relativeOffset: -15 * 60) for 15 minutes beforeEKAlarm(absoluteDate: alertDate) for an absolute timeevent.addAlarm(alarm) or reminder.addAlarm(alarm)try eventStore.save(event1, span: .thisEvent, commit: false) with commit: falsetry eventStore.save(event2, span: .thisEvent, commit: false)try eventStore.commit() to flush to diskEKEventEditViewController()editor.eventStore = eventStoreeditor.editViewDelegate = self (adopt EKEventEditViewDelegate)eventEditViewController(_:didCompleteWith:) to handle .saved, .canceled, .deleted actionsEKEventViewController()viewer.event = existingEventviewer.allowsEditing = true/falseEKCalendarChooser(selectionStyle: .multiple, displayStyle: .allCalendars, entityType: .event, eventStore: eventStore)chooser.showsDoneButton = true and showsCancelButton = truechooser.delegate = self (adopt EKCalendarChooserDelegate).EKEventStoreChanged notification: NotificationCenter.default.addObserver(forName: .EKEventStoreChanged, object: eventStore, queue: .main) { [weak self] _ in self?.refreshEvents() }if authorization not yet determined: request granular access with async method. if denied, show ui directing user to settings app.
if ios 16 or earlier: fallback to legacy requestAccess(to:) callback method; do not call ios 17+ granular methods. check target deployment and branch in code.
if user has write-only access: do not attempt to read events or reminders; skip fetch operations.
if calendar is read-only: check calendar.allowsContentModifications before saving. if false, use eventStore.defaultCalendarForNewEvents instead.
if creating recurring event: decide on span (.thisEvent vs .futureEvents) before save. .thisEvent modifies only the single occurrence; .futureEvents modifies this and all later occurrences in the series.
if batching multiple saves: set commit: false on all saves except the last, or call commit() explicitly after all saves. if commit is not called, changes persist only in memory.
if event store changed notification received: re-fetch events from disk. do not rely on cached EKEvent objects; they are stale.
if time zone is unset: event will appear in the user's local timezone. set explicitly if event time should be fixed to a specific region (e.g., meeting at 9am Pacific regardless of user location).
if reminder fetch returns nil: treat as empty array; reminders not found or fetch timed out. retry with a completion handler or async/await wrapper.
if event has no alarm: event will not trigger notification. add at least one EKAlarm if notification is required.