Chapter 32. Calendar
The user’s calendar information, which the user sees through the Calendar app, is effectively a database. Starting in iOS 4.0, this database can be accessed directly through the Event Kit framework. You’ll link to EventKit.framework and import
A user interface for interacting with the calendar is also provided, by the Event Kit UI framework. This interface basically replicates part of the Calendar app. You’ll link to EventKitUI.framework and import
The calendar database is accessed as an instance of the EKEventStore class. Starting with this instance, you can obtain two kinds of object:
- A calendar
A calendar is a collection of events, usually categorized for some purpose, such as Work or Home. It is an instance of EKCalendar. You can fetch all calendars with the
calendarsproperty, or the default calendar with the
defaultCalendarForNewEventsproperty. Calendars have various types (
type), reflecting the nature of their origin: a calendar can be created and maintained by the user locally (
EKCalendarTypeLocal), but it might also live remotely on the network (
EKCalendarTypeExchange), possibly being updated by subscription (
EKCalendarTypeSubscription); the Birthday calendar (
EKCalendarTypeBirthday) is generated automatically from information in the address book. You can’t create a calendar.
- An event
- An event is a memorandum describing when something happens. It is an instance ...