Galaxy
Galaxy

Reputation: 3400

Xcode 6.1 : UIView.animateWithDuration Extra argument 'usingSpringWithDamping'

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
    )

Upvotes: 5

Views: 2802

Answers (1)

scottphc
scottphc

Reputation: 954

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)
    })

Upvotes: 6

Related Questions