case tidak peka pencarian kata cepat

let filterArray = ["Big green bubble", "Red bubble", "A bubble in green", "Small green bubble", "This bubble is green"]
let textString = "green bubble".lowercased()
let words = textString.components(separatedBy: " ")
let results = filterArray.map { $0.lowercased() }.filter { string in words.allSatisfy { string.components(separatedBy: " ").contains($0) } }

print(results) /* ["Big green bubble", "A bubble in green", "Small green bubble", "This bubble is green"] */
Nayan Dave (iOS Dev.)