I create a code on swift 2, this is the code:
...
var data = []
var filtered = []
...
func myFunc(text: String) {
let resultPredicate = NSPredicate(format: "name_friend contains[c] %@", text)
self.filtered = self.data.filteredArrayUsingPredicate(resultPredicate)
...
}
I rewrite on swift 3, this is the code:
...
var data:[[String:Any]] = []
var filtered:[[String:Any]] = []
...
func myFunc(text: String) {
let resultPredicate = NSPredicate(format: "name_friend contains[c] %@", text)
self.filtered = self.data.filtered(using: resultPredicate)
...
}
But on swift 3 code I receive this message error on self.data.filtered:
Value of type [[String:Any]] has no member 'filtered'
So if the array [[String:Any]] dont have'filtered', whats the way to use the similiar type?