Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

14. Dates, Calendars, and Events > 14.5. Adding Recurring Events to Calendars

14.5. Adding Recurring Events to Calendars

Problem

You want to add a recurring event to a calendar.

Solution

In this example, we are creating an event that occurs on the same day, every month, for an entire year. The steps are as follows:

  1. Create an instance of EKEventStore.

  2. Find a modifiable calendar inside the calendars array of the event store (for more information, refer to Recipe 14.1).

  3. Create an object of type EKEvent (for more information, refer to Recipe 14.2).

  4. Set the appropriate values for the event, such as its startDate and endDate (for more information, refer to Recipe 14.2).

  5. Instantiate an object of type NSDate that contains the exact date when the recurrence of this event ends. In this example, this date is one year from today’s date.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial