If my main array is ["Hello","Bye","Halo"], and I'm searching for "lo", it will filter the array only to ["Hello", "Halo"].
This is what I've tried:
let matchingTerms = filter(catalogNames) {
$0.rangeOfString(self.txtField.text!, options: .CaseInsensitiveSearch) != nil
}
It throws
Type of expression is ambiguous without more context
Any suggestions?