To Filter Model Array:

var filteredItems = unfilteredItems.filter { $0.cat == "garden" }

To Filter an Array:

let result = arr.filter {$0.contains("ali")}