I'm trying to work out how to cast an Int
into a String
in Swift.
I figure out a workaround, using NSNumber
but I'd love to figure out how to do it all in Swift.
let x : Int = 45
let xNSNumber = x as NSNumber
let xString : String = xNSNumber.stringValue
toString
function, shown in an answer below. – Our