title: Swift CAKeyframe Animation not displaying images
body: <p>I have set up a very simple Single View Application (in Swift) using iOS 8.1. I have added one UIImageView to the main view controller view. I am trying to use CAKeyframeAnimation to animate a sequence of images. I was originally using the UIImageView animationImages property which worked fine but I need to be able to know precisely when the animation finishes, hence the move to CAKeyframeAnimation. </p>
  
  <p>My code is as follows: </p>
  
  <pre><code>class ViewController: UIViewController {
  
  
  @IBOutlet weak var imageView: UIImageView!
  var animation : CAKeyframeAnimation!
  
  override func viewDidLoad() {
      super.viewDidLoad()
      // Do any additional setup after loading the view, typically from a nib.
  
      let animationImages:[AnyObject] = [UIImage(named: "image-1")!, UIImage(named: "image-2")!, UIImage(named: "image-3")!, UIImage(named: "image-4")!]
  
      animation = CAKeyframeAnimation(keyPath: "contents")
      animation.calculationMode = kCAAnimationDiscrete
      animation.duration = 25
      animation.values = animationImages
      animation.repeatCount = 25
      animation.removedOnCompletion = false
      animation.fillMode = kCAFillModeForwards
      self.imageView.layer.addAnimation(animation, forKey: "contents")
  
  }
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  }
  
  }
  </code></pre>
  
  <p>The problem is that the animation does not display any images and I just receive a blank screen. Is there something I am missing in the above code? How can I get the animation to display?</p>