I'm writing a function that given an array of objects that contain a property called url
, remove all objects with bad urls.
Here's what I have:
func cleanArray(data:[String: Any])->Void {
let uris = data.filter{($0["url"] as! String).range(of: #"^(https?|file|ftp)"#, options: .regularExpression) != nil };
}
But xcode is showing an error in $0
:
Value of tuple type '(key: String, value: Any)' has no member 'subscript'