You can. You just need to get the syntax right:
let smallerDictionary = bigDictionary.filter { (key, value) in <some test
returning Bool> }
let bd = [1:"A", 2:"B", 3:"C"]
let sd = bd.filter{(k, v) in
k > 1}
dump(sd)
On 27/10/2016, 01:12, "Rick Mann via swift-users"
<[email protected] on behalf of [email protected]> wrote:
It seems fairly natural to want to do this:
let bigDictionary = ...
let smallerDictionary = bigDictionary.filter { key, value in <some test
returning Bool> }
Similarly, it seems natural to want to map this way.
Am I overlooking something?
--
Rick Mann
[email protected]
_______________________________________________
swift-users mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-users
_______________________________________________
swift-users mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-users