Is it possible to change the default timings in icalendar using eventkit?

I used the following code to display a calendar using EVENTKIT

- (BOOL)createEvent:(NSString *)title at:(NSString *)location starting:(NSDate *)startDate ending:(NSDate *)endDate withBody:(NSString *)body { eventStore = [[EKEventStore alloc] init]; EKEvent *event = [EKEvent eventWithEventStore:eventStore]; event.title = title; event.location = location; event.startDate = startDate; event.endDate = endDate; event.notes = body; [event setCalendar:[eventStore defaultCalendarForNewEvents]]; EKEventEditViewController *eventViewController = [[EKEventEditViewController alloc] init]; eventViewController.event = event; eventViewController.eventStore = eventStore; //eventViewController.editViewDelegate = self; [self presentModalViewController:eventViewController animated:YES]; return TRUE; } 

When I call this function above, the eventkit view controller is displayed. When I click the warning button in this, I will get the default warning time, as shown below

Event alert

I want the event notification time to be any way, like 1 day before, 2 days to 30 days.

Can anyone tell me how to do this Thanks a lot in advance

+4
source share
1 answer

You want to create EKAlarm and add this signal to your event. For example, for an alarm that occurs 15 minutes before:

  EKAlarm *alarm = [EKAlarm alarmWithRelativeOffset:-900]; // 15 min alarm [event addAlarm:alarm]; 
+3
source

All Articles