I have this array:
let arrayOfPairs = [ (8, 1), (6, 4), (2, 3), ]
I want this array:
let arrayOfSingleValues =
You can use map to get just the first element of your tuple as follow:
let arrayOfPairs = [(8, 1), (6, 4), (2, 3)] let arrayOfSingleValues = arrayOfPairs.map { $0.0 } print(arrayOfSingleValues) // [8, 6, 2]