Fetch all events from EventStore EventKit iOS

后端 未结 3 1737
梦谈多话
梦谈多话 2020-11-29 02:44

i would like to know how to fetch all events from an EventStore using EventKit in iOS.

This way i can specify all events for today:

- (NSArray *)fetc         


        
3条回答
  •  野性不改
    2020-11-29 02:56

    This is code in production

    const double secondsInAYear = (60.0*60.0*24.0)*365.0;
    NSPredicate* predicate = [eventStore predicateForEventsWithStartDate:[NSDate dateWithTimeIntervalSinceNow:-secondsInAYear] endDate:[NSDate dateWithTimeIntervalSinceNow:secondsInAYear] calendars:nil];
    

    For you, I would recommend looking back and forward ten years.

提交回复
热议问题