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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…