iOS Developer Library

Developer

EventKit Framework Reference EKReminder Class Reference

Options
Deployment Target:

On This Page
Language:

EKReminder

An instance of the EKReminder class represents a reminder added to a calendar in the Event Kit framework.

Use the reminderWithEventStore: method to create a new reminder. Use the properties in the class to get and modify certain information about a reminder.

Inheritance


Conforms To


Import Statement


Swift

import EventKit

Objective-C

@import EventKit;

Availability


Available in iOS 6.0 and later.
  • Creates and returns a new reminder in the given event store.

    Declaration

    Swift

    init!(eventStore eventStore: EKEventStore!) -> EKReminder

    Objective-C

    + (EKReminder *)reminderWithEventStore:(EKEventStore *)eventStore

    Parameters

    eventStore

    The event store.

    Return Value

    The created reminder.

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 6.0 and later.

  • The start date of the task.

    Declaration

    Swift

    @NSCopying var startDateComponents: NSDateComponents!

    Objective-C

    @property(nonatomic, copy) NSDateComponents *startDateComponents

    Discussion

    The use of date components allows the start date and its time zone to be represented in a single property. A nil time zone represents a floating date. Setting a date component without an hour, minute and second component will set the reminder to be an all-day reminder. If this property is set, the calendar must be set to NSGregorianCalendar; otherwise an exception is raised.

    The start date components’s timeZone property corresponds to the timeZone property on EKCalendarItem. A change in one value will cause a change in the other. Setting the time zone directly on the components does not guarantee that your changes will be saved; instead, pull this property from the reminder, set the time zone on it, and assign it back to the reminder:

    • NSDateComponents *start = myEKReminder.startDateComponents;
    • start.timeZone = myNSTimeZone;
    • myEKReminder.startDateComponents = start;

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 6.0 and later.

  • The date by which the reminder should be completed.

    Declaration

    Swift

    @NSCopying var dueDateComponents: NSDateComponents!

    Objective-C

    @property(nonatomic, copy) NSDateComponents *dueDateComponents

    Discussion

    The use of date components allows the due date and its time zone to be represented in a single property. A nil time zone represents a floating date. Setting a date component without an hour, minute and second component will set the reminder to be an all-day reminder. If this property is set, the calendar must be set to NSGregorianCalendar; otherwise an exception is raised.

    This components’s timeZone property is independent of time zone properties on startDateComponents and its super EKCalendarItem object. By default, the due date is set to the system time zone.

    Special Considerations

    On iOS, Event Kit requires that a start date is set if the due date is set, however this is not a requirement on OS X.

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 6.0 and later.

  • completed completed Property

    A Boolean value determining whether or not the reminder is marked completed.

    Declaration

    Swift

    var completed: Bool

    Objective-C

    @property(nonatomic, getter=isCompleted) BOOL completed

    Discussion

    Setting this property to YEStrue will set completionDate to the current date; setting this property to NOfalse will set completionDate to nil.

    Special Considerations

    If the reminder was completed using a different client, you may encounter the case where this property is YEStrue, but completionDate is nil.

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 6.0 and later.

  • The date on which the reminder was completed.

    Declaration

    Swift

    @NSCopying var completionDate: NSDate!

    Objective-C

    @property(nonatomic, copy) NSDate *completionDate

    Discussion

    Setting this property to a date will set completed to YEStrue; setting this property to nil will set completed to NOfalse.

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 6.0 and later.