How can i map/reduce values of one struct array to another using swift's higher order function?. Currently iam iterating over the array and appending each values to new array. Is there any "swifty" method to map the elements to other?
/// Code sample
let priorityList = [Priority]()
let pushRowList = [PushRowList]()
for priority in priorityList {
let id = priority.priorityID
let state = priority.priorityState
let item = PushRowList(optionId: id, optionTitle: state)
pushRowList.append(item)
}
Iam expecting the "swifty" methods like map, reduce etc to perform the operation.