bigfish24 / ABFRealmSearchViewController

Drop-in text search interface for Realm data
MIT License
87 stars 19 forks source link

Override 'searchPredicate(text: String?) -> NSPredicate?' #4

Closed bcamur closed 7 years ago

bcamur commented 8 years ago

Hi, I want to override the searchPredicate function but I can't since it is private. I tried to override refreshSearchResults() since it is public but then I can't access searchQueue property, since it is private. Can you offer another solution? Thanks

bigfish24 commented 8 years ago

There is a basePredicate property that you can override to add additional filtering to the text filtering.

bcamur commented 8 years ago

I am using a predicate like this: NSPredicate(format: "ANY messages.value CONTAINS[c] %@", text) so I can't set the base predicate with a constant. I forked the project and made overriding searchPredicate possible to solve the problem for now, which seems to work.