Reactive Programming with Swift 4
上QQ阅读APP看书,第一时间看更新

Directly access unicode scalars of characters

Swift 4 allows direct access to unicode scalars associated with characters:

let character: Character = “A”
let unicodeScalar = character.unicodeScalars

Done! Easy, isn’t it? Before you would have to convert the character to a String first and then try to access unicode scalar.