Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nil is not compatible with expected argument type UIViewAnimationOptions

Tags:

ios

uiview

swift2

I just started programming and following a tutorial online I was unable to create this animation. Can anyone tell me why it's saying:

Nil is not compatible with expected argument type UIViewAnimationOptions

and how to fix it?

view.addSubview(myFirstLabel)

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

    self.myFirstLabel.center = CGPoint(x: 100, y:40 + 200)

}, completion: nil)
like image 733
Brenner Avatar asked Sep 17 '15 19:09

Brenner


1 Answers

You may replace options: nil with options: [] should make the error goes way.

Good luck !

like image 119
AaoIi Avatar answered Oct 16 '22 08:10

AaoIi