-2

after I updated my Xcode to the Xcode7.0, the method below raises a very strange error: 'Double' is not convertible to 'FloatLiteralConvertible'.

UIView.animateWithDuration(0.5, delay: 0.0, usingSpringWithDamping: 0.5 , initialSpringVelocity: 0.3, options: nil, animations: nil, completion: nil)

Can someone help me?

Mogsdad
  • 42,835
  • 20
  • 145
  • 262
user3788747
  • 102
  • 1
  • 9

1 Answers1

3

The error doesn't seem related to the real problem here, with Swift 2.0 options are now OptionSetType and you should pass an empty Array if you want to specify no options. Also seems I had to specify the closure for animations (non-nullable).

This should work :

UIView.animate(withDuration: 0.5, delay: 0.0, usingSpringWithDamping: 0.5, initialSpringVelocity: 0.3, options: [], animations: {}, completion: nil)
Karen Hovhannisyan
  • 1,020
  • 2
  • 19
  • 29
Fantattitude
  • 1,822
  • 2
  • 18
  • 34