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
I'am not sure but if you have some object in array other than Dictionary (or other type that supports subscripting), you will need to use following code
results.map({$0.attribute})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With