36

i have installed the new iOS 6.1 and Xcode 4.6, and now i have some warning of enumeration in my code, i can't resolve this:

[UIView animateWithDuration:0.4
                          delay:0.0
                        options:UIViewAnimationCurveEaseOut
                     animations:^{

                     } completion:^(BOOL finished) {}];

and this is the warning:

Implicit conversion from enumeration type 'enum UIViewAnimationCurve' to different enumeration type 'UIViewAnimationOptions' (aka 'enum UIViewAnimationOptions')

how i can solve this warning?

starblue
  • 55,348
  • 14
  • 97
  • 151
Piero
  • 9,173
  • 18
  • 90
  • 160

2 Answers2

103

You're using the wrong option value. Try UIViewAnimationOptionCurveEaseOut.

Lily Ballard
  • 182,031
  • 33
  • 381
  • 347
  • 1
    Came across the same problem when going through this RW tutorial: http://www.raywenderlich.com/2454/how-to-use-uiview-animation-tutorial Thanks Kevin Ballard! – Lucas Mar 24 '13 at 03:57
  • on adding UIViewAnimationOptionCurveEaseOut getting error " Use of undeclared identifier 'animationOptions'" – Naresh Apr 10 '13 at 11:28
  • @Naresh make sure you are passing in delay: 0.0f param before the options: param. thus it is animateWithDuration: delay: options: animations: completion: – zonabi Feb 11 '14 at 20:32
2

Replace UIViewAnimationCurveEaseOut into UIViewAnimationOptionCurveEaseOut

Eg:

[UIView animateWithDuration:0.4
                          delay:0.0
                        UIViewAnimationOptionCurveEaseOut
                     animations:^{

                     } completion:^(BOOL finished) {}];
Rajesh Loganathan
  • 11,129
  • 4
  • 78
  • 90