I am trying to implement an image based animation using Swift. I have the image array, duration, and repeat count in the `viewDidLoad`.

```
 override func viewDidLoad() {
    super.viewDidLoad()

    var animationImages:[UIImage] = [
        UIImage(named: "dicey-die1")!,
        UIImage(named: "dicey-die2")!,
        UIImage(named: "dicey-die3")!,
        UIImage(named: "dicey-die4")!,
        UIImage(named: "dicey-die5")!,
        UIImage(named: "dicey-die6")!,
        UIImage(named: "dicey-die1")!,
        UIImage(named: "dicey-die2")!,
        UIImage(named: "dicey-die3")!,
        UIImage(named: "dicey-die4")!,
        UIImage(named: "dicey-die5")!,
        UIImage(named: "dicey-die6")!,
        UIImage(named: "dicey-die1")!,
        UIImage(named: "dicey-die2")!,
        UIImage(named: "dicey-die3")!,
        UIImage(named: "dicey-die4")!,
        UIImage(named: "dicey-die5")!,
        UIImage(named: "dicey-die6")!,
        UIImage(named: "dicey-die1")!,
        UIImage(named: "dicey-die2")!,
        UIImage(named: "dicey-die3")!,
        UIImage(named: "dicey-die4")!,
        UIImage(named: "dicey-die5")!,
        UIImage(named: "dicey-die6")!
    ]

    var animationDuration: NSTimeInterval = 1.0
    var animationRepeatCount: Int = 1

}

```

With the auto complete I am supposed to use The CAAnimation property `animationDidStart()`, in the parentheses it says to use `anim: CAAnimation!` How do I use it? I am trying to animate some dice in my `motionEnded` function. 

```
override func motionEnded(motion: UIEventSubtype, withEvent event: UIEvent) {
    dieImage0.image = randomImages.randomDice();
    dieImage1.image = randomImages.randomDice();
    dieImage2.image = randomImages.randomDice();
    dieImage3.image = randomImages.randomDice();
    dieImage4.image = randomImages.randomDice();
    dieImage5.image = randomImages.randomDice();
    dieImage6.image = randomImages.randomDice();
    dieImage7.image = randomImages.randomDice();

    animationDidStart(anim: CAAnimation!)

    println("Motion Ended")
}

```