Reputation: 171
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
}
Upvotes: 3
Views: 6240
Reputation: 93276
You need to pass Int
types back and forth, and then just cast:
func returnYPosition(yPosition: Int) -> Int {
return Int(userObject.center.y)
}
Upvotes: 5