Animate Text Labels using Spring Physics - error msg


Despite following Paul’s instructions to the latter I keep getting this error msg, I then tried the following and still got an error msg:

This Newbie is truly stuck!! I could so do with some help from my Forum’ers!

Thanks in advance.


The documentation is not the greatest sometimes.

“options A mask of options indicating how you want to perform the animations. For a list of valid constants, see UIViewAnimationOptions.”

options (being plural) I believe means you can pass in more than one option. If you replace the ‘nil’ with ‘[ ]’ it will work. options expects an array so pass it an empty array and you should be good to go. I was stumped on this one as well. I haven’t investigated any options yet.

UIView.animateWithDuration(0.5, delay: 0.0, usingSpringWithDamping: 0.9, initialSpringVelocity: 0.0, options: [], animations: { () -> Void in
  // block or closure which will be executed over 0.5 second (as defined in .animateWithDuration = CGPoint(x: 100, y: 240)
  self.welcomeLabel.alpha = 1.0

  }, completion: nil)



Hey Rob,

Thanks for taking time out to reply to my question, you sure have taught me a valuable insight, I am truly thankful for your advice. Your solution sure sorted out my issue, I’m now glitch free and ready to progress… Genius!!
I also saw after receiving your reply that I had in one of my labels when spelling ‘My’ had entered a lower cap ‘m’ instead of upper cap ‘M’, I suppose that too also contributed to my error issue, and if not, I’m sure it would have thrown up a different error of its own eventually. Once again this newbie is truly thankful to you!


Yes. replace nil with []. This is a big change with the OptionSetType and it will change all of the APIs that take “options” as parameters.

I have a blog post that I just updated with more details on this solution.

You should start variable and method names with a lower case letter (camel case code convention … i.e. code style) Google that for more details.

That did not contribute to the problem, but you should go in and rename it from an uppercase to a lower case first letter in all places that you use it. (Command + Shift + F) Search for it and then replace each one.

Xcode is case sensitive, so it will complain if they don’t match, but I don’t see that error in your image above.

Best Practice
Google search for the error message (right click to copy/paste on error in left panel) or you can type it out (without spelling mistakes).

That’ll help you narrow down on the problem a ton! =)


Thanks for the clarification. I see I wrote ‘array’ instead of ‘set’. It’s an empty set for nil. When I see square brackets I automatically assume array.


Yup… slightly misleading. The Set syntax uses the same Array syntax. But there is a distinction on the methods you can use.

Sets are unique collections (every element must be different), while an array can have duplicate elements. Sets can also do operations like Union, Difference, etc.