Created
March 6, 2015 09:35
-
-
Save GregLukosek/4abccb2594a89b78d934 to your computer and use it in GitHub Desktop.
Find Lowest and highest value in CGFloat Array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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