
Eventkit
- 2.1k installs
- 944 repo stars
- Updated July 15, 2026
- dpearson2699/swift-ios-skills
eventkit is an agent skill that Create, read, and manage calendar events and reminders using EventKit and EventKitUI. Use when adding events to the user's calendar, creating reminders, setting recurrenc.
About
The eventkit skill. Create, read, and manage calendar events and reminders using EventKit and EventKitUI. Use when adding events to the user's calendar, creating reminders, setting recurrence rules, requesting calendar or reminders access, presenting event editors, choosing calendars, handling alarms, observing calendar changes, or working with EKEventStore, EKEvent, EKReminder, EKCalendar, EKRecurrenceRule, EKEventE. Covers authorization, event and reminder CRUD, recurrence rules, alarms, and EventKitUI editors. Direct EventKit writes need write-only or full calendar access; any event read/fetch needs full calendar access. > For apps also running on iOS 10 through iOS 16, include the legacy > / keys. If using > EventKitUI on those systems, also include when the > UI may need contact display names or avatars. Do not mix objects from different event stores. Request the narrowest access that matches the feature. The workflow follows the source SKILL.md contract with progressive reference loading, clear trigger phrases, and practical steps developers can apply directly in agent sessions.
- [Authorization](#authorization)
- [Creating Events](#creating-events)
- [Fetching Events](#fetching-events)
- [Reminders](#reminders)
- [Recurrence Rules](#recurrence-rules)
Eventkit by the numbers
- 2,080 all-time installs (skills.sh)
- +109 installs in the week ending Jul 29, 2026 (Skillselion tracking)
- Ranked #103 of 1,039 Mobile Development skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Jul 31, 2026 (Skillselion catalog sync)
eventkit capabilities & compatibility
- Capabilities
- [authorization](#authorization) · [creating events](#creating events) · [fetching events](#fetching events) · [reminders](#reminders) · [recurrence rules](#recurrence rules)
- Use cases
- testing · debugging · ci cd
What eventkit says it does
Covers authorization, event and reminder CRUD, recurrence rules, alarms, and EventKitUI editors.
Direct EventKit writes need write-only or full calendar access; any event read/fetch needs full calendar access.
npx skills add https://github.com/dpearson2699/swift-ios-skills --skill eventkitAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 2.1k |
|---|---|
| repo stars | ★ 944 |
| Security audit | 3 / 3 scanners passed |
| Last updated | July 15, 2026 |
| Repository | dpearson2699/swift-ios-skills ↗ |
How do I apply eventkit correctly using the SKILL.md workflows and reference files?
Create, read, and manage calendar events and reminders using EventKit and EventKitUI. Use when adding events to the user's calendar, creating reminders, setting recurrence rules, requesting calendar o
Who is it for?
Developers and software engineers working with eventkit patterns from the skill documentation.
Skip if: Skip when cached docs are empty, boilerplate-only, or outside the skill documented scope.
When should I use this skill?
Create, read, and manage calendar events and reminders using EventKit and EventKitUI. Use when adding events to the user's calendar, creating reminders, setting recurrence rules, requesting calendar or reminders access,
What you get
Grounded eventkit guidance with highlights, triggers, and evidence quotes from SKILL.md.
- corrected EventKit integration plan
- authorization flow guidance
- EventKitUI sheet implementation notes
Files
EventKit
Create, read, and manage calendar events and reminders. Covers authorization, event and reminder CRUD, recurrence rules, alarms, and EventKitUI editors. Targets Swift 6.3 / 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 | Direct write-only event creation |
NSRemindersFullAccessUsageDescription | Read + write reminders |
On iOS 17+, an app that only presents EKEventEditViewController to let the person create an event does not need calendar authorization or calendar usage strings. Direct EventKit writes need write-only or full calendar access; any event read/fetch needs full calendar access. Reminders have only full access.
For apps also running on iOS 10 through iOS 16, include the legacy
NSCalendarsUsageDescription/NSRemindersUsageDescriptionkeys. If using
EventKitUI on those systems, also include NSContactsUsageDescription when theUI may need contact display names or avatars.
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. Request the narrowest access that matches the feature. If the deployment target includes earlier OS versions, availability-guard the iOS 17+ methods and fall back to requestAccess(to:) only before iOS 17.
Full Access to Events
Call try await eventStore.requestFullAccessToEvents() when the app needs to read, edit, delete, or fetch calendar events.
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.
Call try await eventStore.requestWriteOnlyAccessToEvents() before direct EventKit writes that do not use EKEventEditViewController.
With write-only access, EventKit can create events but cannot read calendars or events, including events the app created. Calendar reads return a virtual calendar and event fetches return no events.
Use full access instead of write-only if the app must later query, verify, modify, or sync saved events.
Full Access to Reminders
Call try await eventStore.requestFullAccessToReminders() before reading, creating, editing, or deleting reminders.
Checking Authorization Status
Use EKEventStore.authorizationStatus(for: .event) or .reminder before work. Handle .notDetermined, .fullAccess, .writeOnly, .restricted, .denied, and @unknown default; only .fullAccess supports event/reminder reads.
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 = targetCalendarAdding Structured Location
import CoreLocation
let location = EKStructuredLocation(title: "Apple Park")
location.geoLocation = CLLocation(latitude: 37.3349, longitude: -122.0090)
event.structuredLocation = locationFetching Events
Use a date-range predicate to query events. The events(matching:) method returns occurrences of recurring events expanded within the range. Fetching events requires full calendar access; write-only access returns no events. Event predicates are capped to a four-year span, and events(matching:) / enumerateEvents(matching:using:) are synchronous and return only committed events.
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)For reminder geofences, put an EKStructuredLocation and .enter / .leave proximity on an EKAlarm, then add it to the reminder. See references/eventkit-patterns.md for the full location-based reminder pattern.
EventKitUI Controllers
EKEventEditViewController — Create/Edit Events
Present the system event editor for creating or editing events.
On iOS 17+, EKEventEditViewController can let someone create an event without the app requesting calendar access. The editor runs out of process with its own calendar access, so do not inspect the dismissed controller to learn what was saved; refetch only if the app separately has full access.
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
EKCalendarChooser requires write-only or full calendar access. In write-only apps, the chooser behaves as writable-calendars-only and only allows a single writable calendar selection.
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, EKReminder, and EKCalendar objects may be stale. The notification is posted on the main actor.
On iOS 26+, you can also use the typed EKEventStore.EventStoreChanged / .changed notification message behind availability checks.
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()On iOS 17+, requestAccess(to: .event) does not prompt and throws. Keep it only as an availability-guarded fallback for apps that still run on earlier systems.
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 = endDateDON'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.plistusage description keys added for calendars and/or reminders - [ ] Authorization requested with iOS 17+ granular methods, with
requestAccess(to:)only as a pre-iOS 17 fallback - [ ] Write-only calendar access used only for direct event creation, not event/calendar reads
- [ ] Authorization status checked before fetching or saving
- [ ] Full access required before any event or reminder fetch
- [ ] Single
EKEventStoreinstance reused across the app - [ ] Events saved to a writable calendar (
allowsContentModificationschecked) - [ ] Recurring event saves specify correct
EKSpan(.thisEventvs.futureEvents) - [ ] Batched saves followed by explicit
commit() - [ ]
EKEventStoreChangednotification observed to refresh stale data - [ ] iOS 26 typed
.changednotification used only behind availability checks - [ ] 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
{
"skill_name": "eventkit",
"evals": [
{
"id": 1,
"prompt": "Review this iOS 26 calendar integration plan: the app asks for `NSCalendarsUsageDescription`, calls `requestAccess(to: .event)`, requests write-only access, then fetches the user's existing events to avoid conflicts before saving a booking. The team also wants an Add to Calendar button where the user can edit the event in the system sheet. Give corrected guidance with Swift API names where useful.",
"expected_output": "A review that fixes iOS 17+ calendar authorization, Info.plist keys, write-only read limitations, full-access requirements for fetching, and EventKitUI no-authorization creation.",
"files": [],
"assertions": [
"States that iOS 17+ direct EventKit access needs `NSCalendarsWriteOnlyAccessUsageDescription` or `NSCalendarsFullAccessUsageDescription`, not only `NSCalendarsUsageDescription`.",
"States that `requestAccess(to: .event)` is only a pre-iOS 17 fallback and should be availability-guarded when supporting older systems.",
"Explains that write-only event access can create events but cannot read calendars or fetch existing events, including app-created events.",
"Requires full calendar access for fetching existing events to detect conflicts.",
"States that `EKEventEditViewController` can let the user create/edit an event without the app requesting calendar authorization, with the limitation that the app cannot inspect the saved result afterward."
]
},
{
"id": 2,
"prompt": "We need to create reminders when someone enters a job site. The draft code creates an `EKReminder`, assigns a `CLLocation` to `EKStructuredLocation`, adds a blank `EKAlarm()`, skips reminder authorization, and assumes `defaultCalendarForNewReminders()` is always non-nil. What should be fixed?",
"expected_output": "A correction that covers reminder full access, required title/calendar/default-list handling, location-based alarm setup, save behavior, and Core Location privacy only when current location is used.",
"files": [],
"assertions": [
"Requires full reminders access through `requestFullAccessToReminders()` before creating or reading reminders.",
"Checks that `defaultCalendarForNewReminders()` returns a calendar and states that reminder `title` and `calendar` must be set before save.",
"Uses `EKStructuredLocation` with `geoLocation` and a radius in meters for the geofence.",
"Configures an `EKAlarm` with a structured location and `.enter` or `.leave` proximity before adding it to the reminder.",
"Mentions `NSLocationWhenInUseUsageDescription` only if the app accesses the person's current location, not merely for fixed coordinates."
]
},
{
"id": 3,
"prompt": "A teammate wants to use the push notifications layer for all calendar alerts: every event and reminder should schedule a `UNNotificationRequest`, and EventKit should only store title/start/end dates. Review the boundary and recommend the right approach.",
"expected_output": "A boundary answer that keeps Calendar/Reminders alarms in EventKit, hands app-owned notification workflows to push notifications, and avoids expanding EventKit into APNs guidance.",
"files": [],
"assertions": [
"Recommends `EKAlarm` for Calendar event or Reminders alarms that should live with the calendar/reminder item.",
"Mentions relative or absolute event alarms using `EKAlarm(relativeOffset:)` or `EKAlarm(absoluteDate:)` and `addAlarm(_:)`.",
"Mentions structured-location reminders as an EventKit reminder alarm case when location is part of the reminder.",
"Hands off app-owned local/remote notification delivery to `UNUserNotificationCenter` or the push-notifications skill instead of turning EventKit into APNs guidance.",
"Does not claim EventKit calendar/reminder alarms require push notification authorization from the app."
]
}
]
}
EventKit Extended Patterns
Overflow reference for the eventkit skill. Contains advanced patterns that exceed the main skill file's scope.
Contents
- SwiftUI Calendar Integration
- Advanced Predicate Queries
- Batch Operations
- Calendar Management
- Reminder Workflows
- EventKitUI in SwiftUI
- Typed Change Notifications
SwiftUI Calendar Integration
Read event data only after full calendar access. Write-only access can create events but cannot read calendars or events, including events the app created. When supporting iOS 16 or earlier, availability-guard iOS 17+ access requests and use requestAccess(to:) only on the older path.
Observable Event Manager
import EventKit
import SwiftUI
@Observable
@MainActor
final class CalendarManager {
let eventStore = EKEventStore()
var events: [EKEvent] = []
var authorizationStatus: EKAuthorizationStatus = .notDetermined
func requestAccess() async {
do {
let granted = try await eventStore.requestFullAccessToEvents()
authorizationStatus = granted ? .fullAccess : .denied
if granted { fetchThisWeekEvents() }
} catch {
authorizationStatus = .denied
}
}
func fetchThisWeekEvents() {
let calendar = Calendar.current
let start = calendar.startOfDay(for: Date())
let end = calendar.date(byAdding: .day, value: 7, to: start)!
let predicate = eventStore.predicateForEvents(
withStart: start,
end: end,
calendars: nil
)
events = eventStore.events(matching: predicate)
.sorted { $0.startDate < $1.startDate }
}
func observeChanges() {
NotificationCenter.default.addObserver(
forName: .EKEventStoreChanged,
object: eventStore,
queue: .main
) { [weak self] _ in
self?.fetchThisWeekEvents()
}
}
}SwiftUI View with Calendar Events
struct CalendarEventsView: View {
@State private var manager = CalendarManager()
var body: some View {
List(manager.events, id: \.eventIdentifier) { event in
VStack(alignment: .leading) {
Text(event.title)
.font(.headline)
Text(event.startDate, style: .date)
.font(.caption)
.foregroundStyle(.secondary)
}
}
.task {
await manager.requestAccess()
manager.observeChanges()
}
.overlay {
if manager.events.isEmpty {
ContentUnavailableView(
"No Events",
systemImage: "calendar",
description: Text("No events this week.")
)
}
}
}
}Advanced Predicate Queries
Event predicates search at most a four-year span. events(matching:) and enumerateEvents(matching:using:) are synchronous and include only committed events, so commit batched changes before querying and move large reads off the main actor when needed.
Events in a Specific Calendar
func fetchEvents(in calendar: EKCalendar, range: DateInterval) -> [EKEvent] {
let predicate = eventStore.predicateForEvents(
withStart: range.start,
end: range.end,
calendars: [calendar]
)
return eventStore.events(matching: predicate)
}Completed Reminders in a Date Range
func fetchCompletedReminders(from start: Date, to end: Date) async -> [EKReminder] {
let predicate = eventStore.predicateForCompletedReminders(
withCompletionDateStarting: start,
ending: end,
calendars: nil
)
return await withCheckedContinuation { continuation in
eventStore.fetchReminders(matching: predicate) { reminders in
continuation.resume(returning: reminders ?? [])
}
}
}Enumerating Events Efficiently
For large date ranges, use enumerateEvents to process events one at a time without loading all into memory.
func processAllEvents(from start: Date, to end: Date) {
let predicate = eventStore.predicateForEvents(
withStart: start,
end: end,
calendars: nil
)
eventStore.enumerateEvents(matching: predicate) { event, stop in
// Process each event
if event.title.contains("Cancel") {
stop.pointee = true // Stop enumeration early
}
}
}Batch Operations
Creating Multiple Events Efficiently
Use commit: false for individual saves, then commit once at the end.
func createEvents(from entries: [(String, Date, Date)]) throws {
for (title, start, end) in entries {
let event = EKEvent(eventStore: eventStore)
event.title = title
event.startDate = start
event.endDate = end
event.calendar = eventStore.defaultCalendarForNewEvents
try eventStore.save(event, span: .thisEvent, commit: false)
}
try eventStore.commit()
}Deleting Events in Bulk
func deleteEvents(_ events: [EKEvent]) throws {
for event in events {
try eventStore.remove(event, span: .thisEvent, commit: false)
}
try eventStore.commit()
}Resetting Unsaved Changes
// Discard all uncommitted changes
eventStore.reset()Calendar Management
Creating a Custom Calendar
func createCalendar(name: String, color: CGColor) throws -> EKCalendar {
let calendar = EKCalendar(for: .event, eventStore: eventStore)
calendar.title = name
calendar.cgColor = color
// Find a local source (iCloud, local, etc.)
if let localSource = eventStore.sources.first(where: {
$0.sourceType == .local
}) {
calendar.source = localSource
} else if let defaultSource = eventStore.defaultCalendarForNewEvents?.source {
calendar.source = defaultSource
}
try eventStore.saveCalendar(calendar, commit: true)
return calendar
}Listing Calendars by Type
// All event calendars
let eventCalendars = eventStore.calendars(for: .event)
// All reminder calendars
let reminderCalendars = eventStore.calendars(for: .reminder)
// Only writable calendars
let writableCalendars = eventCalendars.filter { $0.allowsContentModifications }Reminder Workflows
Reminder with Location-Based Alarm
import CoreLocation
import EventKit
enum CalendarError: Error {
case remindersAccessRequired
case missingDefaultReminderList
}
func createLocationReminder(
title: String,
latitude: Double,
longitude: Double
) throws {
guard EKEventStore.authorizationStatus(for: .reminder) == .fullAccess else {
throw CalendarError.remindersAccessRequired
}
guard let reminderCalendar = eventStore.defaultCalendarForNewReminders() else {
throw CalendarError.missingDefaultReminderList
}
let reminder = EKReminder(eventStore: eventStore)
reminder.title = title
reminder.calendar = reminderCalendar
let location = EKStructuredLocation(title: "Target Location")
location.geoLocation = CLLocation(latitude: latitude, longitude: longitude)
location.radius = 200 // meters
let alarm = EKAlarm(relativeOffset: 0)
alarm.structuredLocation = location
alarm.proximity = .enter // .enter or .leave
reminder.addAlarm(alarm)
try eventStore.save(reminder, commit: true)
}If the app uses the person's current location while creating location-based reminders, add NSLocationWhenInUseUsageDescription and request Core Location authorization in the location layer.
Reminder with Priority
let reminder = EKReminder(eventStore: eventStore)
reminder.title = "Important Task"
reminder.priority = 1 // 1-4: High, 5: Medium, 6-9: Low, 0: None
reminder.calendar = eventStore.defaultCalendarForNewReminders()EventKitUI in SwiftUI
UIViewControllerRepresentable for Event Editor
import SwiftUI
import EventKitUI
struct EventEditView: UIViewControllerRepresentable {
let eventStore: EKEventStore
@Binding var isPresented: Bool
func makeUIViewController(context: Context) -> EKEventEditViewController {
let editor = EKEventEditViewController()
editor.eventStore = eventStore
editor.editViewDelegate = context.coordinator
return editor
}
func updateUIViewController(
_ uiViewController: EKEventEditViewController,
context: Context
) {}
func makeCoordinator() -> Coordinator {
Coordinator(self)
}
class Coordinator: NSObject, EKEventEditViewDelegate {
let parent: EventEditView
init(_ parent: EventEditView) {
self.parent = parent
}
func eventEditViewController(
_ controller: EKEventEditViewController,
didCompleteWith action: EKEventEditViewAction
) {
parent.isPresented = false
}
}
}On iOS 17+, the editor can create events without app calendar authorization. It runs out of process, so the app cannot inspect the dismissed controller to learn what the person saved unless the app separately has full access and refetches.
Usage in SwiftUI
struct CalendarView: View {
@State private var showEditor = false
let eventStore = EKEventStore()
var body: some View {
Button("Add Event") { showEditor = true }
.sheet(isPresented: $showEditor) {
EventEditView(
eventStore: eventStore,
isPresented: $showEditor
)
}
}
}Typed Change Notifications
Use .EKEventStoreChanged for broad compatibility. On iOS 26+, the typed notification message is available when you want Foundation's message API:
if #available(iOS 26.0, *) {
let observation = NotificationCenter.default.addObserver(
of: eventStore,
for: .changed
) { _ in
fetchThisWeekEvents()
}
}Related skills
How it compares
Use eventkit for native iOS EventKit and EventKitUI integration; use backend scheduling skills when calendar logic must live on a server instead of the device.
FAQ
Who is eventkit for?
Developers and software engineers working with eventkit patterns from the skill documentation.
When should I use eventkit?
Create, read, and manage calendar events and reminders using EventKit and EventKitUI. Use when adding events to the user's calendar, creating reminders, setting recurrence rules, requesting calendar or reminders access, presenting event editors, choosing calendars, handling alarm
Is eventkit safe to install?
Review the Security Audits panel on this page before installing in production.