Accessing different types of calendars

suggest change

Accessing the array of calendars

To access the array of EKCalendars, we use the calendarsForEntityType method:

Swift

let calendarsArray = eventStore.calendarsForEntityType(EKEntityType.Event) as! [EKCalendar]

Iterating through calendars

Just use a simple for loop:

Swift

for calendar in calendarsArray{
    //...
}

Accessing the calendar title and color

Swift

let calendarColor = UIColor(CGColor: calendar.CGColor)
let calendarTitle = calendar.title

Objective-C

UIColor *calendarColor = [UIColor initWithCGColor: calendar.CGColor];
NSString *calendarTitle = calendar.title;

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents