user2636197 user2636197 - 1 year ago 136
iOS Question

Swift change cgpoint .center value

I am using a CGPoint value to set where a animation starts.

transition.startingPoint =

If I do
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

Answer Source

Here is what you need:

var startingPoint =
startingPoint.y += 20
transition.startingPoint = startingPoint


let buttonCenter =
transition.startingPoint = CGPoint(x: buttonCenter.x, y: buttonCenter.y + 20)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download