Xcode 6.1:UIView.animateWithDuration额外的参数' usingSpringWithDamping'

时间:2014-10-24 02:57:10

标签: ios xcode swift

我不知道错误的原因,"额外的争论' usingSpringWithDamping'在电话"突然出现在下面。

我刚刚开始,所以任何帮助都将不胜感激!

    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
    )

1 个答案:

答案 0 :(得分:6)

试试这个:

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