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 compati
UIViewAnimationOptions is an enum backed by integers. You should pass 0. Here is the doc for the enum.
You may replace options: nil
with options: []
should make the error goes way.
Good luck !
It's because UIViewAnimationOptions
is an OptionSet
type, not Optional type
OptionSet
according to apple
You use the OptionSet protocol to represent
bitset
types, where individual bits represent members of a set.
it's mainly used to create a combined flag from the current flags inside the set,
in your case animation flags or types we can call them, this will give you the ability to combine options to make the final desired option, there are about 23 option, however in your case you can just pass an empty OptionSet
as []