I am trying to animate a UIView with spring animations using swift. I can achieve this when I use objective C, however I get an error quickly. This is the animation:
UIView.animateWithDuration(3, usingSpringWithDamping: 0.3, initialSpringVelocity: 3.0, animations:{ viewToAnimate.frame.offset(dx: 0, dy: 100.0)}, completion: nil)
The compiler gives me an error message
Could not find an overload for 'animateWithDuration' that accepts supplied arguments.
If I remove "usingSpringWithDamping: 0.3, initialSpringVelocity: 3.0," it compiles and animates perfectly. How can I make spring animations in swift?
source share