Skip to content

Instantly share code, notes, and snippets.

@MartinJNash
Created April 26, 2015 10:08
func randBetween(range: Range<Int>) -> Int {
let num = arc4random_uniform(UInt32(range.endIndex + 1))
return Int(num) + range.startIndex
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment