Convert Character to Integer in Swift -


i creating iphone app , need convert single digit number integer.

my code has variable called char has type character, need able math it, therefore think need convert string, cannot find way that.

with character can create string. , string can create int.

let char: character = "1" if let number = int(string(char)) {     // use number     } 

Comments

Popular posts from this blog

ios - Memory not freeing up after popping viewcontroller using ARC -

Java JSoup error fetching URL -

webstorm - PhpStorm file cache conflict with TypeScript compiler -