Last Updated: February 25, 2016
·
1.551K
· yariok

Calendar Events and Permissions in iOS 6

Picture

Prior to iOS 6, accessing the calendar didn’t require any permission. We just had to create an event store and then we were able to add events through it.

With iOS6 the story is slightly different: to create a new event we ask the user for the permission to access his calendar.

Thanks to the new function requestAccessToEntityType:completion: that has been added to the EKEventStore, this operation is extremely simple.

Full article here:
http://www.thinkandbuild.it/calendar-events-and-permissions-in-ios-6/

//Request the access to the Calendar
[eventStore requestAccessToEntityType:EKEntityTypeEvent
completion:^(BOOL granted,NSError* error){        
    //Access not granted-------------
    if(!granted){
     
    }
                
    //Access granted------------------
    }else{
     
    }
}];