EKCalendar Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/EventKit.framework |
| Availability | Available in iOS 4.0 and later. |
| Declared in | EKCalendar.h EKTypes.h |
Overview
An instance of the EKCalendar class represents a calendar in Event Kit. Use the properties in this class to get attributes about a calendar, such as its title and type. Use the calendarForEntityType:eventStore: method to create a calendar object.
Tasks
Creating Calendars
-
+ calendarForEntityType:eventStore: -
+ calendarWithEventStore:Deprecated in iOS 6.0
Accessing Calendar Properties
-
allowsContentModificationsproperty -
CGColorproperty -
immutableproperty -
titleproperty -
typeproperty -
allowedEntityTypesproperty -
sourceproperty -
subscribedproperty -
supportedEventAvailabilitiesproperty -
calendarIdentifierproperty
Properties
allowedEntityTypes
The entity types this calendar can contain. (read-only)
Discussion
While Event Kit only allows creation of single-entity calendars, other servers might allow mixed-entity calendars.
Availability
- Available in iOS 6.0 and later.
Declared In
EKCalendar.hallowsContentModifications
A Boolean value that indicates whether you can add, edit, and delete items in the calendar. (read-only)
Availability
- Available in iOS 4.0 and later.
Declared In
EKCalendar.hcalendarIdentifier
A unique identifier for the calendar. (read-only)
Discussion
This property is set when the calendar is created and can be used as a local identifier. Use calendarWithIdentifier: to get a calendar with the specified identifier.
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.
Availability
- Available in iOS 5.0 and later.
See Also
Declared In
EKCalendar.hCGColor
The calendar’s color.
Special Considerations
This property is the equivalent of the color property on OS X.
Availability
- Available in iOS 4.0 and later.
Declared In
EKCalendar.himmutable
A Boolean value indicating whether the calendar’s properties can be edited or deleted. (read-only)
Discussion
If YES, the calendar is immutable; otherwise it is not. Events and reminders can still be added to an immutable calendar.
Availability
- Available in iOS 5.0 and later.
Declared In
EKCalendar.hsource
The source object representing the account to which this calendar belongs.
Discussion
This property can only be set for newly created calendar objects. This property is read-only after the first time it is set; setting a value to this property after the first time it is set will result in an error. Therefore, moving a calendar from one source to another is not supported.
Availability
- Available in iOS 5.0 and later.
Declared In
EKCalendar.hsubscribed
A Boolean value indicating whether the calendar is a subscribed calendar. (read-only)
Discussion
If YES, the calendar is a subscribed calendar; otherwise it is not.
Availability
- Available in iOS 5.0 and later.
Declared In
EKCalendar.hsupportedEventAvailabilities
The event availability settings supported by this calendar, as indicated by a bitmask. (read-only)
Discussion
If the calendar doesn’t support event availability settings, this value is EKCalendarEventAvailabilityNone.
Availability
- Available in iOS 4.0 and later.
Declared In
EKCalendar.htitle
The calendar’s title.
Availability
- Available in iOS 4.0 and later.
Declared In
EKCalendar.htype
The calendar’s type. (read-only)
Discussion
CalDAV-subscribed calendars are of type EKCalendarTypeCalDAV with isSubscribed set to YES.
Availability
- Available in iOS 4.0 and later.
See Also
Declared In
EKCalendar.hClass Methods
calendarForEntityType:eventStore:
Creates a new calendar that can contain the given entity type.
Parameters
- entityType
The entity type that this calendar may support.
- eventStore
The event store in which to create this calendar.
Return Value
The created calendar.
Discussion
You can only create calendars that accept either reminders or events. Some servers might allow mixing the two, although it is not common.
Availability
- Available in iOS 6.0 and later.
Declared In
EKCalendar.hConstants
EKCalendarType
Possible calendar types.
typedef enum {
EKCalendarTypeLocal,
EKCalendarTypeCalDAV,
EKCalendarTypeExchange,
EKCalendarTypeSubscription,
EKCalendarTypeBirthday,
} EKCalendarType;
Constants
EKCalendarTypeLocalA local calendar.
Available in iOS 4.0 and later.
Declared in
EKTypes.h.EKCalendarTypeCalDAVA CalDAV or iCloud calendar.
Available in iOS 4.0 and later.
Declared in
EKTypes.h.EKCalendarTypeExchangeAn Exchange calendar.
Available in iOS 4.0 and later.
Declared in
EKTypes.h.EKCalendarTypeSubscriptionA locally subscribed calendar.
Available in iOS 4.0 and later.
Declared in
EKTypes.h.EKCalendarTypeBirthdayA birthday calendar.
Available in iOS 4.0 and later.
Declared in
EKTypes.h.
Availability
- Available in iOS 4.0 and later.
Declared In
EKTypes.hEKCalendarEventAvailabilityMask
A bitmask indicating the event availability settings that the calendar can support.
typedef NSUInteger EKCalendarEventAvailabilityMask;
Availability
- Available in iOS 4.0 and later.
Declared In
EKTypes.hEKCalendarEventAvailability
Event availability settings that the calendar can support.
enum {
EKCalendarEventAvailabilityNone = 0,
EKCalendarEventAvailabilityBusy = (1 << 0),
EKCalendarEventAvailabilityFree = (1 << 1),
EKCalendarEventAvailabilityTentative = (1 << 2),
EKCalendarEventAvailabilityUnavailable = (1 << 3),
};
Constants
EKCalendarEventAvailabilityNoneThe calendar does not support event availability settings.
Available in iOS 4.0 and later.
Declared in
EKTypes.h.EKCalendarEventAvailabilityBusyThe calendar supports the busy event availability setting.
Available in iOS 4.0 and later.
Declared in
EKTypes.h.EKCalendarEventAvailabilityFreeThe calendar supports the free event availability setting.
Available in iOS 4.0 and later.
Declared in
EKTypes.h.EKCalendarEventAvailabilityTentativeThe calendar supports the tentative event availability setting.
Available in iOS 4.0 and later.
Declared in
EKTypes.h.EKCalendarEventAvailabilityUnavailableThe calendar supports the unavailable event availability setting.
Available in iOS 4.0 and later.
Declared in
EKTypes.h.
© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-07-17)