Mac Developer Library

Developer

EventKit Framework Reference EKEvent Class Reference

Options
Deployment Target:

On This Page
Language:

EKEvent

An instance of the EKEvent class represents an event added to a calendar in the Event Kit framework. More...

Conforms To


Import Statement


import EventKit @import EventKit;

Availability


Available in OS X v10.8 and later.
  • Creates and returns a new event belonging to a specified event store.

    Declaration

    Swift

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

    Objective-C

    + (EKEvent *)eventWithEventStore:(EKEventStore *)eventStore

    Parameters

    eventStore

    The event store to which the event belongs.

    Return Value

    The created event.

    Import Statement

    import EventKit

    Availability

    Available in OS X v10.8 and later.

  • A unique identifier for the event. (read-only)

    Declaration

    Swift

    var eventIdentifier: String! { get }

    Objective-C

    @property(nonatomic, readonly) NSString *eventIdentifier

    Discussion

    You can use this identifier to look up an event with the EKEventStore method eventWithIdentifier:.

    If the calendar of an event changes, its identifier most likely changes as well.

    Import Statement

    import EventKit

    Availability

    Available in OS X v10.8 and later.

  • The availability setting for the event.

    Declaration

    Swift

    var availability: EKEventAvailability

    Objective-C

    @property(nonatomic) EKEventAvailability availability

    Discussion

    This setting is used by CalDAV and Exchange servers to indicate how the event should be treated for scheduling purposes.

    If the event’s calendar does not support availability settings, this property’s value is EKEventAvailabilityNotSupported.

    Import Statement

    import EventKit

    Availability

    Available in OS X v10.8 and later.

  • startDate startDate Property

    The start date of the event.

    Declaration

    Swift

    @NSCopying var startDate: NSDate!

    Objective-C

    @property(nonatomic, copy) NSDate *startDate

    Discussion

    Floating events such as all-day events are returned in the default time zone.

    Import Statement

    import EventKit

    Availability

    Available in OS X v10.8 and later.

  • endDate endDate Property

    The end date for the event.

    Declaration

    Swift

    @NSCopying var endDate: NSDate!

    Objective-C

    @property(nonatomic, copy) NSDate *endDate

    Import Statement

    import EventKit

    Availability

    Available in OS X v10.8 and later.

  • allDay allDay Property

    A Boolean value that indicates whether the event is an all-day event.

    Declaration

    Swift

    var allDay: Bool

    Objective-C

    @property(nonatomic, getter=isAllDay) BOOL allDay

    Import Statement

    import EventKit

    Availability

    Available in OS X v10.8 and later.

  • The original occurrence date of an event if it is part of a recurring series. (read-only)

    Declaration

    Swift

    var occurrenceDate: NSDate! { get }

    Objective-C

    @property(nonatomic, readonly) NSDate *occurrenceDate

    Discussion

    This value will remain the same even if the event has been detached and its start date has changed. Floating events (such as all-day events) are returned in the default time zone.

    Special Considerations

    This property is not available on iOS.

    Import Statement

    import EventKit

    Availability

    Available in OS X v10.8 and later.

  • A Boolean value that indicates whether an event is a detached instance of a repeating event. (read-only)

    Declaration

    Swift

    var isDetached: Bool { get }

    Objective-C

    @property(nonatomic, readonly) BOOL isDetached

    Discussion

    This value is YEStrue if and only if the event is part of a repeating event and one or more of its attributes have been modified from the repeating event’s default attributes.

    Import Statement

    import EventKit

    Availability

    Available in OS X v10.8 and later.

  • organizer organizer Property

    The organizer associated with the event. (read-only)

    Declaration

    Swift

    var organizer: EKParticipant! { get }

    Objective-C

    @property(nonatomic, readonly) EKParticipant *organizer

    Discussion

    This property is nil if the event has no organizer.

    Import Statement

    import EventKit

    Availability

    Available in OS X v10.8 and later.

  • status status Property

    The status of the event. (read-only)

    Declaration

    Swift

    var status: EKEventStatus { get }

    Objective-C

    @property(nonatomic, readonly) EKEventStatus status

    Discussion

    You should act based on an event’s status only if the status is EKEventStatusCanceled, which indicates that the event has been canceled. Other statuses should be considered informational.

    Import Statement

    import EventKit

    Availability

    Available in OS X v10.8 and later.

    See Also

    EKEventStatus

  • The Address Book framework record identifier of the person for this birthday event. (read-only)

    Declaration

    Swift

    var birthdayPersonUniqueID: String! { get }

    Objective-C

    @property(nonatomic, readonly) NSString *birthdayPersonUniqueID

    Discussion

    This property is only set if this is a birthday event; otherwise the property is nil.

    Special Considerations

    Import Statement

    import EventKit

    Availability

    Available in OS X v10.8 and later.

  • Updates the event’s data with the current information in the Calendar database.

    Declaration

    Swift

    func refresh() -> Bool

    Objective-C

    - (BOOL)refresh

    Return Value

    If the event was successfully refreshed, YEStrue; otherwise, NOfalse.

    Discussion

    You should call this method only on events that your application is editing, and only when your application receives the EKEventStoreChangedNotification notification. If this method returns NOfalse, the event has been deleted or otherwise invalidated, and you should not continue to use it.

    This method does not replace the values of any properties that you have modified.

    Import Statement

    import EventKit

    Availability

    Available in OS X v10.8 and later.

Data Types

  • The event’s availability setting for scheduling purposes.

    Declaration

    Swift

    struct EKEventAvailability { init(_ value: Int32) var value: Int32 }

    Objective-C

    typedef enum { EKEventAvailabilityNotSupported = -1, EKEventAvailabilityBusy = 0, EKEventAvailabilityFree, EKEventAvailabilityTentative, EKEventAvailabilityUnavailable } EKEventAvailability;

    Constants

    • EKEventAvailabilityNotSupported

      EKEventAvailabilityNotSupported

      Availability settings are not supported by the event’s calendar.

      Available in OS X v10.8 and later.

    • EKEventAvailabilityBusy

      EKEventAvailabilityBusy

      The event has a busy availability setting.

      Available in OS X v10.8 and later.

    • EKEventAvailabilityFree

      EKEventAvailabilityFree

      The event has a free availability setting.

      Available in OS X v10.8 and later.

    • EKEventAvailabilityTentative

      EKEventAvailabilityTentative

      The event has a tentative availability setting.

      Available in OS X v10.8 and later.

    • EKEventAvailabilityUnavailable

      EKEventAvailabilityUnavailable

      The event has an unavailable availability setting.

      Available in OS X v10.8 and later.

    Import Statement

    import EventKit

    Availability

    Available in OS X v10.8 and later.

  • The event’s status.

    Declaration

    Swift

    struct EKEventStatus { init(_ value: UInt32) var value: UInt32 }

    Objective-C

    typedef enum { EKEventStatusNone = 0, EKEventStatusConfirmed, EKEventStatusTentative, EKEventStatusCanceled, } EKEventStatus;

    Constants

    • EKEventStatusNone

      EKEventStatusNone

      The event has no status.

      Available in OS X v10.8 and later.

    • EKEventStatusConfirmed

      EKEventStatusConfirmed

      The event is confirmed.

      Available in OS X v10.8 and later.

    • EKEventStatusTentative

      EKEventStatusTentative

      The event is tentative.

      Available in OS X v10.8 and later.

    • EKEventStatusCanceled

      EKEventStatusCanceled

      The event is canceled.

      Available in OS X v10.8 and later.

    Import Statement

    import EventKit

    Availability

    Available in OS X v10.8 and later.