EKEvent Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/EventKit.framework |
| Availability | Available in iOS 4.0 and later. |
| Companion guide | |
| Declared in | EKEvent.h |
Overview
An instance of the EKEvent class represents an event added to a calendar in the Event Kit framework.
Use the eventWithEventStore: method to create a new event. Use the properties in the class to get and modify certain information about an event. Other properties, such as the event’s title and calendar, are inherited from the parent class EKCalendarItem.
Tasks
Creating Events
Accessing Event Properties
-
eventIdentifierproperty -
availabilityproperty -
startDateproperty -
endDateproperty -
allDayproperty -
isDetachedproperty -
organizerproperty -
statusproperty -
birthdayPersonIDproperty -
recurrenceRuleproperty Available in iOS 4.0 through iOS 5.1
Comparing Events
Refreshing Event Data
Properties
allDay
A Boolean value that indicates whether the event is an all-day event.
Availability
- Available in iOS 4.0 and later.
Declared In
EKEvent.havailability
The availability setting for the event.
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.
Availability
- Available in iOS 4.0 and later.
See Also
Declared In
EKEvent.hbirthdayPersonID
The Address Book framework record identifier of the person for this birthday event. (read-only)
Discussion
This property is only set if this is a birthday event; otherwise the property is nil.
Special Considerations
Availability
- Available in iOS 5.0 and later.
Declared In
EKEvent.hendDate
The end date for the event.
Availability
- Available in iOS 4.0 and later.
Declared In
EKEvent.heventIdentifier
A unique identifier for the event. (read-only)
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.
Availability
- Available in iOS 4.0 and later.
Declared In
EKEvent.hisDetached
A Boolean value that indicates whether an event is a detached instance of a repeating event. (read-only)
Discussion
This value is YES 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.
Availability
- Available in iOS 4.0 and later.
Declared In
EKEvent.horganizer
The organizer associated with the event. (read-only)
Discussion
This property is nil if the event has no organizer.
Availability
- Available in iOS 4.0 and later.
Declared In
EKEvent.hstartDate
The start date of the event.
Discussion
Floating events such as all-day events are returned in the default time zone.
Availability
- Available in iOS 4.0 and later.
Declared In
EKEvent.hstatus
The status of the event. (read-only)
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.
Availability
- Available in iOS 4.0 and later.
See Also
Declared In
EKEvent.hClass Methods
eventWithEventStore:
Creates and returns a new event belonging to a specified event store.
Parameters
- eventStore
The event store to which the event belongs.
Return Value
The created event.
Availability
- Available in iOS 4.0 and later.
Declared In
EKEvent.hInstance Methods
compareStartDateWithEvent:
Compares the start date of the receiving event with the start date of another event.
Parameters
- other
The event to compare against.
Return Value
NSOrderedAscendingif the start date of the receiver precedes the start date ofother.NSOrderedSameif the start dates of the two events are identical.NSOrderedDescendingif the start date of the receiver comes after the start date ofother.
Discussion
You can pass the selector for this method to the NSArray method sortedArrayUsingSelector: to create an array of events sorted by start date.
Availability
- Available in iOS 4.0 and later.
Declared In
EKEvent.hrefresh
Updates the event’s data with the current information in the Calendar database.
Return Value
If the event was successfully refreshed, YES; otherwise, NO.
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 NO, 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.
Availability
- Available in iOS 4.0 and later.
Declared In
EKEvent.hConstants
EKEventAvailability
The event’s availability setting for scheduling purposes.
typedef enum {
EKEventAvailabilityNotSupported = -1,
EKEventAvailabilityBusy = 0,
EKEventAvailabilityFree,
EKEventAvailabilityTentative,
EKEventAvailabilityUnavailable
} EKEventAvailability;
Constants
EKEventAvailabilityNotSupportedAvailability settings are not supported by the event’s calendar.
Available in iOS 4.0 and later.
Declared in
EKEvent.h.EKEventAvailabilityBusyThe event has a busy availability setting.
Available in iOS 4.0 and later.
Declared in
EKEvent.h.EKEventAvailabilityFreeThe event has a free availability setting.
Available in iOS 4.0 and later.
Declared in
EKEvent.h.EKEventAvailabilityTentativeThe event has a tentative availability setting.
Available in iOS 4.0 and later.
Declared in
EKEvent.h.EKEventAvailabilityUnavailableThe event has an unavailable availability setting.
Available in iOS 4.0 and later.
Declared in
EKEvent.h.
Availability
- Available in iOS 4.0 and later.
Declared In
EKEvent.hEKEventStatus
The event’s status.
typedef enum {
EKEventStatusNone = 0,
EKEventStatusConfirmed,
EKEventStatusTentative,
EKEventStatusCanceled,
} EKEventStatus;
Constants
EKEventStatusNoneThe event has no status.
Available in iOS 4.0 and later.
Declared in
EKEvent.h.EKEventStatusConfirmedThe event is confirmed.
Available in iOS 4.0 and later.
Declared in
EKEvent.h.EKEventStatusTentativeThe event is tentative.
Available in iOS 4.0 and later.
Declared in
EKEvent.h.EKEventStatusCanceledThe event is canceled.
Available in iOS 4.0 and later.
Declared in
EKEvent.h.
Availability
- Available in iOS 4.0 and later.
Declared In
EKEvent.h© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-07-17)