O'Reilly logo

iPhone Location Aware Apps by Example by Zeeshan Chawdhary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action — adding events to your iPhone calendar

We take the Hello Events (SQLite example) and extend it to add Events onto our iOS calendar using EventKit and EventKit UI framework.

  1. Add EventKit and EventKit UI framework to your project.
  2. In your Hello_EventsViewController.h, define the variables for the EventStore, Event Calendar, and Event object as follows:
    EKEventStore *eventStore;
    EKCalendar *eventCalendar;
    EKEvent *event;
    NSMutableArray *eventList;
    EKEventEditViewController *eventController;
    
  3. We also define an array to hold our events data (of the type EKEvent) in an array, so we can parse through the events array and add it to the calendar on user input.
  4. The EKEventEditViewController object allows us to use the core iOS Calendar ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required