Skip to content

Instantly share code, notes, and snippets.

@avdyushin
Created February 15, 2016 09:59
Show Gist options
  • Save avdyushin/2c1cda4905082a7bcda8 to your computer and use it in GitHub Desktop.
Save avdyushin/2c1cda4905082a7bcda8 to your computer and use it in GitHub Desktop.
Swift Character get ASCII code value
extension Character {
var asciiValue: Int {
get {
let s = String(self).unicodeScalars
return Int(s[s.startIndex].value)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment