I am having a calendar with name MyCalendar.
I have stored some events to that calendar..
I know how to delete all the events from the calendar..as below
NSDate *startDate = [NSDate date];
NSDate* endDate = [NSDate dateWithTimeIntervalSinceNow:[[NSDate distantFuture] timeIntervalSinceReferenceDate]];
NSArray *calendarArray = [NSArray arrayWithObject:self.defaultCalendar];
NSPredicate *predicate = [self.eventStore predicateForEventsWithStartDate:startDate
endDate:endDate
calendars:calendarArray];
NSArray *events = [self.eventStore eventsMatchingPredicate:predicate];
for (EKEvent *event in events) {
NSError* err = nil;
[self.eventStore removeEvent:event span:EKSpanFutureEvents commit:YES error:&err];
}
But when user deleted my app from device. How can I delete all the events related to Calendar MyCalendar.
As unnecessary some events of the deleted app still exists at device calendar.
It is worst to keep events related to My App if user don't want to use My App..
Any Ideas & Suggestions are appreciated..Is it possible?
Thanks in Advance..