A NSPredicate category to help with a dinamic Search (smart search)
To run the example project, clone the repo, and run pod install
from the Example directory first.
let predicate = NSPredicate(search: query, searchTerm: "name")
self.array.filter(using: predicate!)
self.array = NSMutableArray(array:self.arrayAll.filtered(using: predicate!))
NSPredicate *predicate = [NSPredicate predicateWithSearch:searchText searchTerm:@"searchTerms"];
self.arrayData = [[NSMutableArray alloc] initWithArray:[self.arrayAllData filteredArrayUsingPredicate:predicate]];
iOS 8 +
NSPredicateSearch is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "NSPredicateSearch"
Narlei A Moreira, [email protected]
NSPredicateSearch is available under the MIT license. See the LICENSE file for more info.
Pay me a coffee: