I\'ve so far got a simple (but potentially expensive) way:
var myMax = sort(myArray,>)[0]
And how I was taught to do it at school:
You can use with reduce:
reduce
let randomNumbers = [4, 7, 1, 9, 6, 5, 6, 9] let maxNumber = randomNumbers.reduce(randomNumbers[0]) { $0 > $1 ? $0 : $1 } //result is 9