Animating a View in Swift

You're missing a parameter. The method also takes a delay as input.

UIView.animate(withDuration: 1.0, delay: 0.0, usingSpringWithDamping: 0.3, initialSpringVelocity: 3.0, options: UIView.AnimationOptions.curveEaseInOut, animations: ({
    // do stuff
}), completion: nil)

Try this:

UIView.animateWithDuration(0.7, delay: 0.0, usingSpringWithDamping: 0.5,
initialSpringVelocity: 0.5, options: [], animations: 
{
    self.yourView.transform = CGAffineTransformMakeScale(1, 1)
}, completion: nil)

Tags:

Swift

Xcode6

Ios8