Skip to content

Commit

Permalink
Search filter matches name or venue
Browse files Browse the repository at this point in the history
  • Loading branch information
mcritz committed Apr 19, 2019
1 parent e4a09e8 commit 1fc38e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SF iOS/SF iOS/Models/EventDataSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ - (Event *)eventAtIndex:(NSUInteger)index {
/// - returns:
/// - RLMResults<Event *> *: array of matching Events
- (RLMResults<Event *> *)filterEventsWithSearchTerm:(NSString *)searchTerm {
NSPredicate *coffeeFilter = [NSPredicate predicateWithFormat:@"name CONTAINS[c] %@", searchTerm];
NSPredicate *coffeeFilter = [NSPredicate predicateWithFormat:@"name CONTAINS[c] %@ OR venue.name CONTAINS[c] %@", searchTerm, searchTerm];
RLMResults<Event *> *filteredCoffee = [[Event objectsWithPredicate:coffeeFilter]
sortedResultsUsingKeyPath:@"date" ascending:false];
return filteredCoffee;
Expand Down

0 comments on commit 1fc38e2

Please sign in to comment.