How do you convert a @IValue CGFloat to an Int?
I keep getting a cannot convert @IValue CGFloat to Integer with the following:
@IBOutlet var userObject : UIImageView
func returnYPosition(yPosition: Integer) -> Integer {
return userObject.center.y
}
You need to pass Int types back and forth, and then just cast:
func returnYPosition(yPosition: Int) -> Int {
return Int(userObject.center.y)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With