Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Generating a random A-Z character in swift
let uppercaseLetters = Array(65...90).map {String(UnicodeScalar($0))}
func randomLetter() -> String {
let randomIndex = arc4random_uniform(UInt32(uppercaseLetters.count))
return uppercaseLetters[Int(randomIndex)]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.