Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 6.1 : UIView.animateWithDuration Extra argument 'usingSpringWithDamping'

Tags:

xcode

ios

swift

I don't know why the error, "Extra argument 'usingSpringWithDamping' in call" is suddenly appearing for the following.

I'm just starting out, so any help would be appreciated!

    UIView.animateWithDuration(1.0,
        delay: 0,
        usingSpringWithDamping: 1.5,
        initialSpringVelocity: 5.0,
        options: UIViewAnimationOptions.CurveEaseInOut | UIViewAnimationOptions.AllowUserInteraction,
        animations: {
            self.view.backgroundColor = newColor
            self.funFactLabel.transform = CGAffineTransformMakeScale(1.25, 1.25)
        }, completion: { finished in
            UIView.animateWithDuration(2.0,
                delay: 0,
                usingSpringWithDamping: 0.5,
                initialSpringVelocity: 5.0,                    
                options: nil,
                animations: {
                    self.funFactLabel.transform = CGAffineTransformMakeScale(1.0, 1.0)
                }
            )}, completion: nil
    )
like image 575
Galaxy Avatar asked Oct 24 '14 02:10

Galaxy


1 Answers

Try this:

UIView.animateWithDuration(1.0,
    delay: 0,
    usingSpringWithDamping: 1.5,
    initialSpringVelocity: 5.0,
    options: UIViewAnimationOptions.CurveEaseInOut | UIViewAnimationOptions.AllowUserInteraction,
    animations: {
        self.view.backgroundColor = newColor
        self.funFactLabel.transform = CGAffineTransformMakeScale(1.25, 1.25)
    }, completion: { finished in
        UIView.animateWithDuration(2.0,
            delay: 0,
            usingSpringWithDamping: 0.5,
            initialSpringVelocity: 5.0,
            options: nil,
            animations: {
                self.funFactLabel.transform = CGAffineTransformMakeScale(1.0, 1.0)
            } , completion: nil)
    })
like image 187
scottphc Avatar answered Nov 20 '22 06:11

scottphc