iOS Developer Library

Developer

EventKit Framework Reference EKCalendarItem Class Reference

Options
Deployment Target:

On This Page
Language:

EKCalendarItem

Inheritance


Conforms To


Import Statement


Swift

import EventKit

Objective-C

@import EventKit;

Availability


Available in iOS 5.0 and later.

The EKCalendarItem class is a an abstract superclass for calendar events and reminders. This class provides common properties and methods for accessing properties of calendar items such as the ability to set the calendar, title, and location as well as support for attaching notes, displaying attendees, setting multiple alarms, and specifying recurrence rules.

  • The calendar item’s unique identifier. (read-only)

    Declaration

    Swift

    var calendarItemIdentifier: String! { get }

    Objective-C

    @property(nonatomic, readonly) NSString *calendarItemIdentifier

    Discussion

    This property is set when the calendar item is created and can be used as a local identifier. Use calendarItemWithIdentifier: to look up the item by this value.

    A full sync with the calendar will lose this identifier. You should have a plan for dealing with a calendar whose identifier is no longer fetch-able by caching its other properties.

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 6.0 and later.

  • The calendar item’s external identifier as provided by the calendar server. (read-only)

    Declaration

    Swift

    var calendarItemExternalIdentifier: String! { get }

    Objective-C

    @property(nonatomic, readonly) NSString *calendarItemExternalIdentifier

    Discussion

    This identifier allows you to access the same event or reminder across multiple devices.

    There are some cases where duplicate copies of a calendar item can exist in the same database:

    • A calendar item was imported from an ICS file into multiple calendars

    • An event was created in a calendar shared with the user and the user was also invited to the event

    • The user is a delegate of a calendar that also has this event

    • A subscribed calendar was added to multiple accounts

    In such cases, you should choose between calendar items based on other factors, such as the calendar or source.

    Recurring event identifiers are the same for all occurrences. If you wish to differentiate between occurrences, you may want to use the start date.

    For Exchange servers, the identifier is different between iOS and OS X and different between devices for reminders.

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 6.0 and later.

  • UUID UUID (iOS 6.0) Property

    The calendar item’s unique identifier. (read-only)

    Declaration

    Objective-C

    @property(nonatomic, readonly) NSString *UUID

    Import Statement

    Objective-C

    @import EventKit;

    Availability

    Available in iOS 5.0 and later.

    Deprecated in iOS 6.0.

    See Also

    calendarItemIdentifier
    calendarItemExternalIdentifier

  • calendar calendar Property

    The calendar for the calendar item.

    Declaration

    Swift

    var calendar: EKCalendar!

    Objective-C

    @property(nonatomic, retain) EKCalendar *calendar

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 5.0 and later.

  • title title Property

    The title for the calendar item.

    Declaration

    Swift

    var title: String!

    Objective-C

    @property(nonatomic, copy) NSString *title

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 5.0 and later.

  • location location Property

    The location associated with the calendar item.

    Declaration

    Swift

    var location: String!

    Objective-C

    @property(nonatomic, copy) NSString *location

    Discussion

    This property is nil if the calendar item has no location.

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 5.0 and later.

  • The date that this calendar item was created. (read-only)

    Declaration

    Swift

    var creationDate: NSDate! { get }

    Objective-C

    @property(nonatomic, readonly) NSDate *creationDate

    Discussion

    If nil, this property was not set or was synced in this state.

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 5.0 and later.

    See Also

    lastModifiedDate

  • The date that the calendar item was last modified. (read-only)

    Declaration

    Swift

    var lastModifiedDate: NSDate! { get }

    Objective-C

    @property(nonatomic, readonly) NSDate *lastModifiedDate

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 5.0 and later.

    See Also

    creationDate

  • timeZone timeZone Property

    The time zone for the calendar item.

    Declaration

    Swift

    @NSCopying var timeZone: NSTimeZone!

    Objective-C

    @property(nonatomic, copy) NSTimeZone *timeZone

    Discussion

    If nil, the calendar item is a floating event. A floating event is not tied to a particular time zone. It occurs at a given time regardless of the time zone — for example, “lunch at noon.” The start and end times of a floating event should be set as if they were in the system time zone.

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 5.0 and later.

  • URL URL Property

    The URL for the calendar item.

    Declaration

    Swift

    @NSCopying var URL: NSURL!

    Objective-C

    @property(nonatomic, copy) NSURL *URL

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 5.0 and later.

  • hasNotes hasNotes Property

    A Boolean value that indicates whether the calendar item has notes. (read-only)

    Declaration

    Swift

    var hasNotes: Bool { get }

    Objective-C

    @property(nonatomic, readonly) BOOL hasNotes

    Discussion

    If YEStrue, the calendar item has notes; otherwise it does not.

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 5.0 and later.

    See Also

    notes

  • notes notes Property

    The notes associated with the calendar item.

    Declaration

    Swift

    var notes: String!

    Objective-C

    @property(nonatomic, copy) NSString *notes

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 5.0 and later.

    See Also

    hasNotes

  • A Boolean value that indicates whether the calendar item has attendees. (read-only)

    Declaration

    Swift

    var hasAttendees: Bool { get }

    Objective-C

    @property(nonatomic, readonly) BOOL hasAttendees

    Discussion

    If YEStrue, the calendar item has attendees; otherwise it does not.

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 5.0 and later.

    See Also

    attendees

  • attendees attendees Property

    The attendees associated with the calendar item, as an array of EKParticipant objects. (read-only)

    Declaration

    Swift

    var attendees: [AnyObject]! { get }

    Objective-C

    @property(nonatomic, readonly) NSArray *attendees

    Discussion

    This property is read-only; it is not possible to add attendees with Event Kit. This property is nil if the calendar item has no attendees.

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 5.0 and later.

    See Also

    hasAttendees

  • hasAlarms hasAlarms Property

    A Boolean value that indicates whether the calendar item has alarms. (read-only)

    Declaration

    Swift

    var hasAlarms: Bool { get }

    Objective-C

    @property(nonatomic, readonly) BOOL hasAlarms

    Discussion

    If YEStrue, the calendar item has alarms; otherwise it does not.

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 5.0 and later.

  • Adds an alarm to the receiver.

    Declaration

    Swift

    func addAlarm(_ alarm: EKAlarm!)

    Objective-C

    - (void)addAlarm:(EKAlarm *)alarm

    Parameters

    alarm

    The alarm to be added.

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 5.0 and later.

  • Removes an alarm from the calendar item.

    Declaration

    Swift

    func removeAlarm(_ alarm: EKAlarm!)

    Objective-C

    - (void)removeAlarm:(EKAlarm *)alarm

    Parameters

    alarm

    The alarm to be removed.

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 5.0 and later.

  • alarms alarms Property

    The alarms associated with the calendar item, as an array of EKAlarm objects.

    Declaration

    Swift

    var alarms: [AnyObject]!

    Objective-C

    @property(nonatomic, copy) NSArray *alarms

    Discussion

    This property is nil if the calendar item has no alarms.

    Import Statement

    Objective-C

    @import EventKit;

    Swift

    import EventKit

    Availability

    Available in iOS 5.0 and later.