Map all properties to a new value but maintain Collection type?

A way to do what you seem to be trying to do is:

mutating func accumulate() -> Double {
    tickets = tickets.map {
      var copy = $0
      copy.price += 2.0
      return copy
    }
    return tickets.reduce(0) {$0 + $1}
}
1 Like