Chapter 16. Using Event Kit on the iPhone and iPad

 

This chapter covers

  • Overview of the Event Kit frameworks
  • Adding an event programmatically
  • Using Event Kit view controllers
  • Fetching events by using Grand Central Dispatch

With the Calendar app in iOS 4, iPhone or iPad owners can easily consolidate their Gmail account, Microsoft Exchange account, Mobile Me account, and other calendar accounts on the same device. The Calendar’s database can be accessed within your application through Event Kit frameworks. The Event Kit frameworks are made up of two frameworks: the Event Kit framework and the Event Kit UI framework. Together, they help your application access the Calendar’s database from a high level. Previously, in chapter 9, we covered the Address Book frameworks on iOS. The Event Kit frameworks are quite similar to the Address Book API in a way.

Imagine you can build a birthday event planner application and have every friend’s birthday party plan automatically added to the Calendar’s database by clicking one button. In this chapter, we’ll first provide some basic references on the Event Kit framework with the Birthday application, and then we’ll show another Event application to fetch and display the existing events from the Calendar’s database to the table view controller, with the help of the Event Kit UI framework. Finally, with the help of Grand Central Dispatch (GCD) from iOS 4, we’ll demonstrate an improved technique for fetching data from Calendar’s database.

16.1. An overview of the Event Kit frameworks

16.2. Adding new events to Calendar programmatically

16.3. Creating an event with the Event Edit view controller

16.4. Fetching events

16.5. Fetching events with GCD

16.6. Summary