I have an array of Items
struct Item {
var id: String
}
How can I append all the ids to an array using reduce function?
What I try:
self.items.reduce([String](), { $0.0.append($0.1.id)})
But compiler shows an error:
Contextual closure type '(_, [Item]) -> _' expects 2 arguments, but 1 was used in closure body