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" 
<swift-users-boun...@swift.org on behalf of swift-users@swift.org> 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
    rm...@latencyzero.com
    
    
    _______________________________________________
    swift-users mailing list
    swift-users@swift.org
    https://lists.swift.org/mailman/listinfo/swift-users
    


_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to