ViewController viewDidLoad 関数の UIView.animateWithDuration 呼び出しがアニメーション化されません。完了ブロックはすぐに呼び出されます。println の出力は、'completion true' を示しています。viewDidLoad 関数は、スタートアップ アニメーションを配置するのに間違った場所ですか? どんなヒントでも大歓迎です。
class ViewController: UIViewController {
@IBOutlet var beatIndicator:UIView?
override func viewDidLoad() {
super.viewDidLoad()
if let led = beatIndicator? {
led.alpha = 1.0
led.frame = CGRectMake(20, 20, 30, 30)
led.layer.cornerRadius = 15
UIView.animateWithDuration(3.0, animations:{
led.alpha = 0.5
led.frame = CGRectMake(25, 25, 20, 20)
led.layer.cornerRadius = 10
}, completion:{(value: Bool) in
println("completion \(value)")
})
}
// ...
}
}