According to this answer, to obtain the maximum of an array we can do:
let nums = [1, 6, 3, 9, 4, 6]; let numMax = nums.reduce(Int.min, { max($0, $1) })
Just use the first array element as the initial value:
let numMax = floats.reduce(floats[0], { max($0, $1) })
but of course you need to check that the floats array is not empty before doing it.
floats