Is there an easier / more efficient way to initialize a dictionary from an array in Swift 3?
for object in array {
dict[object.id] = object
}
Nothing wrong with that, but I was wondering if you can use map / reduce / etc to do this with a little less code.
source
to share