Skip to content

Instantly share code, notes, and snippets.

@GregLukosek
Created March 6, 2015 09:35
Show Gist options
  • Save GregLukosek/4abccb2594a89b78d934 to your computer and use it in GitHub Desktop.
Save GregLukosek/4abccb2594a89b78d934 to your computer and use it in GitHub Desktop.
Find Lowest and highest value in CGFloat Array
var data: [CGFloat] = [10, 50, 20, 5, 5, 10]
let minValue = data.reduce(data[0], { min($0, $1) })
let maxValue = data.reduce(data[0], { max($0, $1) })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment