I have an array of struct containing several fields. I want to map the array to create another one of struct containing a subset of fields
struct History: {
let field1: String
let field2: String
let field3: String
let field4: String
}
struct SubHistory: {
let field1: String
let field2: String
}
I could use the for in loop. But It may be possible to use a map, no ?
let subHistoryArray = historyArray.map{SubHistory(field1: $0.field1, field2: $0.field2)}