-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
  • 44,709
  • 21
  • 151
  • 275
user3788747
  • 112
  • 2
  • 11

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,140
  • 2
  • 21
  • 31
Fantattitude
  • 1,842
  • 2
  • 18
  • 34