In Swift, i cant cast Int to String by:
var iString:Int = 100 var strString = String(iString)
But my variable in Int? , there for error:
You can try this to convert Int? to string
let myString : String = "42" let x : Int? = myString.toInt() let newString = "\(x ?? 0)" print(newString) // if x is nil then optional value will be "0"