Skip to content

Instantly share code, notes, and snippets.

@el-hoshino
Created January 30, 2018 03:30
Show Gist options
  • Save el-hoshino/3f4f166f5b0e2df399cad0d7786b37c8 to your computer and use it in GitHub Desktop.
Save el-hoshino/3f4f166f5b0e2df399cad0d7786b37c8 to your computer and use it in GitHub Desktop.
Using Scanner to scan String to Int in Swift (Objective-C way)
let string = "123"
let scanner = Scanner(string: string)
var int = NSNotFound
scanner.scanInt(&int)
print(int)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment