I want to convert a
var float: Float = 2.2
var integer: Int = float as Float
'Float' is not convertible to 'Int'
You can convert
Int in Swift like this:
var myIntValue:Int = Int(myFloatValue) println "My value is \(myIntValue)"
You can also achieve this result with @paulm's comment:
var myIntValue = Int(myFloatValue)