I get filtered objects like:
realm.objects(Post.self).filter("title contains '\(searchText)'")
But I need case insensitive search option, Realm docs say:
Case-insensitive comparisons for strings, such as name CONTAINS[c] ‘Ja’. Note that only characters “A-Z” and “a-z” will be ignored for case. Can be combined with the [d] modifier.
So how do I need do?
realm.objects(Post.self).filter("title contains[c] '\(searchText)'")
doesn't work...
UPD:
Got it. I was trying filter cyrillic symbols. So next question, where can I add cyrillic filtering?
Please use NSPredicate's interpolation rather than String interpolation:
realm.objects(Post.self).filter("title contains[c] %@", searchText)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With