How to write array.valueForKey in Swift?

Viewed 3108

What's the most convenient code to write

[results valueForKey:@"attribute"]

in swift? I've found here that it's recommended to use the map() function with a closure:

swiftarray.map({$0["attribute"]})

N.B. swiftarray is not a NSArray

3 Answers
Related