requestAccessToEntity for both iOS6 and 5.x - EKEventStore

Posted by ShiShi on Stack Overflow See other posts from Stack Overflow or by ShiShi
Published on 2012-09-30T09:34:43Z Indexed on 2012/09/30 9:37 UTC
Read the original article Hit count: 356

Filed under:
|
|
|

following iOS6 eventKit and the new privacy settings I am using the following code - which works perfectly fine on iOS6 devices.

Still, I would like the same code to work also for devices with iOS 5.x and I wish not to write a the "same code" twice - Seems wrong.

Can anyone assist in an elegant solution ?

 EKEventStore *eventStore = [[EKEventStore alloc] init];
    [eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) {

// some code 


}];

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about ios