3
class Example: NSObject, UIViewControllerAnimatedTransitioning, UIViewControllerTransitioningDelegate {

var aView : UIView!

UIView.animateWithDuration(duration, delay: 0.0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0.8, options: nil, animations: {

       self.aView.transform = CGAffineTransformIdentity //This line is throwing the error mentioned in the Title


            }, completion: { finished in
                transitionContext.completeTransition(true)
      })


}

This was working in earlier version of Swift but failing in version 2 not sure why

Prashanth
  • 518
  • 1
  • 8
  • 21

1 Answers1

5

You just have to change

UIView.animateWithDuration(duration,
  delay: 0.0,
  usingSpringWithDamping: 0.8,
  initialSpringVelocity: 0.8,
  options: nil,
  animations: {

with:

UIView.animateWithDuration(duration,
  delay: 0.0,
  usingSpringWithDamping: 0.8,
  initialSpringVelocity: 0.8,
  options: [],
  animations: {

There is just the "options" to change.

Kristian
  • 21,204
  • 19
  • 101
  • 176
Antoine
  • 1,139
  • 9
  • 21