Swift: Get an array of element from an array of tuples Swift: Get an array of element from an array of tuples arrays arrays

Swift: Get an array of element from an array of tuples


That's simple:

answers.map { $0.number }


var ints = answers.map { tuple in    tuple.0}


If your tuple is not named you can do this:

let mappedInts = answers.map({$0.0})let mappedBools = answers.map({$0.1})