I want to move an UIImageView, I already did this in Objective-C and it completely worked. This was the code:
tank.center = CGPointMake(tank.center.x + TankX, tank.center.y + TankY);
TankX
is set in viewDidLoad to 2 and TankY
is set to 0. So the tank moves to the right.
But when i want to do this in Swift it doesn't work.
Swift code:
tank.center = CGPointMake(tank.center.x + TankX, tank.center.y + TankY)
I also tried CGPoint but I also can't get it working. I already saw this question: CGPointMake in Swift but I couldn't manage to use it.
Does anyone have an idea how to do this?
Edit: Error: Could not find an overload for '+' that accepts the supplied arguments