In Swift 4, I'm trying to compare the length of the text of an UISearchBar textfield with a minimum length:
@objc var arrRes = [[String:AnyObject]]()
var searcharr = [String]()
private func searchBar( searchBar: UISearchBar, textDidChange searchText: [[String:AnyObject]] )
{
searcharr = arrRes.filter({$0.prefix(searchText.count) == searchText})
}
But I am getting the error:
Binary operator '==' cannot be applied to operands of type 'Slice<Dictionary>' and '[[String : AnyObject]]'