我使用以下代码使用 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;
}
当我调用上面的函数时,会显示一个 eventkit 视图控制器。当我单击其中的警报按钮时,我将获得默认的警报时间,如下所示
我希望在 1 天前、2 天前到 30 天前以任何我希望的方式进行事件警报时间。
任何人都可以请告诉我如何做到这一点提前非常感谢