You cannot just draw with as . There is a method that explicitly expresses Int .
let x = "1".toInt()
Note that the result is of type Int? , because Swift cannot know in advance if the conversion is successful.
println(x!)
Or:
let x = "1".toInt()!
Mundi source share