Reputation: 4122
I am using a CGPoint value to set where a animation starts.
transition.startingPoint = startButton.center
If I do print(startButton.center)
the output will be: (292.0, 22.0)
What I now want to do is to edit that values Y position so the animation starts a bit lower on the screen and I can pass the new value to the transition.startingPoint = newVal
Upvotes: 1
Views: 3388
Reputation: 7741
Here is what you need:
var startingPoint = startButton.center
startingPoint.y += 20
transition.startingPoint = startingPoint
Or:
let buttonCenter = startButton.center
transition.startingPoint = CGPoint(x: buttonCenter.x, y: buttonCenter.y + 20)
Upvotes: 6