Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone 'Event Kit' - how can I specify additional search filters for a fetch (beyond start/end date)?

re iPhone 'Event Kit':

How can I specify additional search filters (per doco here) for a fetching calendar items, beyond the limited options of just start & end date mentioned in the doco? (e.g. all events occurring on Mondays, or with title matching xxx)

Or is it a given that there are no such capabilities beyond what is available in predicateForEventsWithStartDate:endDate:calendars: , hence you need to bring in all events and then iterate through them yourself?

like image 479
Greg Avatar asked Feb 25 '11 19:02

Greg


People also ask

How do I add categories to my iPhone Calendar?

To begin customizing the iPhone calendars, enter the Calendar app and tap Calendars at the bottom of the screen. The list of existing calendars and color codes will appear. To add a calendar tap Edit at the top left of the screen. Touch Add Calendar at the bottom of the list of existing calendar categories.

How do I get my iPhone Calendar to automatically add emails to Calendar?

To turn Events Found in Mail on or off, open Settings. Tap Mail, Contacts, Calendars. Scroll down and found Events Found in Mail. Toggle it on for automatic mail events added to Calendar app and off for manual input.


1 Answers

The documentation has a clear answer to your question. See the notes for the eventsMatchingPredicate: method:

predicate The search predicate. Must be created with the predicateForEventsWithStartDate:endDate:calendars: method.

Since that method does not allow you to give any other criteria than the dates and the calendars to search in, those are your options. Everything else must be done by iterating over the search results.

like image 139
Ole Begemann Avatar answered Nov 03 '22 13:11

Ole Begemann