The Reminder
API allows users to create, edit, and manage reminders in iOS calendars. It supports features such as setting titles, due dates, priorities, and recurrence rules, enabling comprehensive reminder management.
Reminder
The Reminder
class provides methods and properties for creating and managing reminders within a calendar.
identifier: string
A unique identifier for the reminder, assigned by the system when the reminder is created.
calendar: Calendar
The calendar associated with the reminder. Reminders must be linked to a specific calendar.
title: string
The title of the reminder, typically a brief description of the task.
notes?: string
Additional notes or details about the reminder.
isCompleted: boolean
Indicates whether the reminder is marked as completed.
true
automatically sets completionDate
to the current date.false
sets completionDate
to null
.Special Considerations:
If the reminder was completed using another client, isCompleted
may be true
, but completionDate
could still be null
.
priority: number
The priority level of the reminder. Higher values indicate higher priority.
completionDate?: Date
The date the reminder was completed.
isCompleted = true
).null
unmarks the reminder as completed (isCompleted = false
).dueDate?: Date
The date by which the reminder should be completed.
dueDateIncludesTime: boolean
Indicates whether the dueDate
includes a time component. Defaults to true
.
false
, the time component of dueDate
is ignored.recurrenceRules?: RecurrenceRule[]
The recurrence rules associated with the reminder.
hasRecurrenceRules: boolean
Indicates whether the reminder has recurrence rules.
addRecurrenceRule(rule: RecurrenceRule): void
Adds a recurrence rule to the reminder.
removeRecurrenceRule(rule: RecurrenceRule): void
Removes a recurrence rule from the reminder.
remove(): Promise<void>
Deletes the reminder from the calendar.
save(): Promise<void>
Saves changes to the reminder. If the reminder is new, it is created in the associated calendar.
Reminder.getAll(calendars?: Calendar[]): Promise<Reminder[]>
Fetches all reminders from the specified calendars. If no calendars are specified, retrieves reminders from all calendars.
Reminder.getIncompletes(options?: { startDate?: Date; endDate?: Date; calendars?: Calendar[] }): Promise<Reminder[]>
Fetches all incomplete reminders within the specified date range and calendars.
startDate
: Only include reminders due after this date. Defaults to null
.endDate
: Only include reminders due before this date. Defaults to null
.calendars
: Specifies which calendars to search. Defaults to all calendars.Reminder.getCompleteds(options?: { startDate?: Date; endDate?: Date; calendars?: Calendar[] }): Promise<Reminder[]>
Fetches all completed reminders within the specified date range and calendars.
startDate
: Only include reminders completed after this date. Defaults to null
.endDate
: Only include reminders completed before this date. Defaults to null
.calendars
: Specifies which calendars to search. Defaults to all calendars.dueDateIncludesTime
property to specify whether the time component is relevant for the reminder.getIncompletes
and getCompleteds
to filter reminders by their status and a specified date range.