Ad

Swift UIViewAnimation With Spring Moves To Wrong Place Then Jumps

- 1 answer

I'm trying to animate a label moving to another place with a spring effect.

UIView.animateWithDuration(1, delay: 1, usingSpringWithDamping: 0.9, initialSpringVelocity: 0, options: [], animations: { () -> Void in
    self.textLabel.center = CGPointMake(self.view.center.x, self.view.center.y-220)
}, completion: { (Bool) -> Void in
})

Basically it animates the label moving to a wrong place but after the animation finishes it suddenly jumps to the place I want it to go to.

What is causing this issue?

Ad

Answer

I had an animation inside another animation and it caused this issue. Now it is solved.

Ad
source: stackoverflow.com
Ad