随着beta 5的更改,我遇到了与下面扩展中的KeyType和ValueType相关的错误.
extension Dictionary {
func filter(predicate: (key: KeyType, value: ValueType) -> Bool) -> Dictionary {
var filteredDictionary = Dictionary()
for (key, value) in self {
if predicate(key: key, value: value) {
filteredDictionary.updateValue(value, forKey: key)
}
}
return filteredDictionary
}
}
Run Code Online (Sandbox Code Playgroud)
我可能会遗漏一些东西,但我似乎无法在发行说明中找到任何相关的更改,我知道这在beta 3中有效.