Здесь я перечислю все события из календаря, но это не показывает 2017 событий, я знаю только 4 года выше деталей кокетливыми, но нет никаких записей, получать с 2017EKEvents будущие события не работают
EKEventStore *store = [[EKEventStore alloc] init]; [store requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) {
NSLog(@"acces to §Reminder granded %i ",granted);
[parser parse];
}];
NSDate* startDate = [NSDate dateWithTimeIntervalSinceNow:-1 * 60 * 60 * 24 * 365 * 4];
NSDate* endDate = [NSDate dateWithTimeIntervalSinceNow:[[NSDate distantFuture] timeIntervalSinceReferenceDate]];
NSPredicate *fetchCalendarEvents = [store predicateForEventsWithStartDate:startDate endDate:endDate calendars:nil];
eventList = [store eventsMatchingPredicate:fetchCalendarEvents];
calanderDict =[[NSMutableDictionary alloc]init];
for(int i=0; i < eventList.count; i++){
NSLog(@"Event Title:%@", [[eventList objectAtIndex:i] title]);
NSLog(@"Event StartDate:%@", [[eventList objectAtIndex:i] startDate]);
NSLog(@"Event EndDate:%@", [[eventList objectAtIndex:i] endDate]);
// NSLog(@"Event Notes:%@", [[eventList objectAtIndex:i]notes]);
NSLog(@"Event Identifier:%@", [[eventList objectAtIndex:i] calendarItemIdentifier]);
[calanderDict setObject:[[eventList objectAtIndex:i] title] forKey:@"Title"];
[calanderDict setObject:[[eventList objectAtIndex:i] startDate] forKey:@"Creation_date"];
[calanderDict setObject:[[eventList objectAtIndex:i] endDate] forKey:@"End_date"];
[calanderDict setObject:[[eventList objectAtIndex:i]calendarItemIdentifier] forKey:@"Identifier"];
[calList addObject:[calanderDict copy]];
}
NSLog(@"Cal List %@",calList);