0

我在 Xcode 7 beta 2 中输入了一些简单的动画代码-

 UIView.animateWithDuration( 0.5, delay: 1, options: nil, animations: ({
        self.W.frame = CGRect(x: 107, y: 268, width: 30, height: 33)
        self.nameLabel.alpha = 0
        self.wd.alpha = 0

    } ), completion:{ finished in
        UIView.animateWithDuration(0.5, animations: ( { ()-> Void in self.wd.alpha = 1 } ), completion: {finished in
            UIView.animateWithDuration(0.5, delay: 1, options: nil, animations: ({()-> Void in
                self.greenLaunchScreenView.alpha = 0
                self.nameLabel.alpha = 0
                self.wd.alpha = 0
                self.W.alpha = 0
                self.launchScreenCircle.alpha = 0
                self.navigationController?.setNavigationBarHidden( false, animated: true )
            }), completion: nil )

            }
        )})

当我在 Xcode 6 中键入相同的代码时,它可以完美运行,但它在 Xcode 7 beta 2 中不起作用,因为它给了我一个错误-“表达式类型不明确,没有更多上下文”。如何使此代码在 Xcode 7 beta 中工作?

4

1 回答 1

1

在 Xcode 7 (Swift 2) 中,请使用[]代替nilfor 参数options:UIView.animateWithDuration

于 2015-07-31T07:57:48.010 回答