0

When trying to make an animation in UIView it says 'implicit conversion from enumeration type'

My code is:

[UIView animateWithDuration:0.5 delay:0 options:UIViewAnimationCurveEaseIn animations:^{
    [pea setFrame:CGRectMake(82, 224, 35, 35)];
} completion:^(BOOL finished){}];

Just wondering how I can fix this?

Rob
  • 415,655
  • 72
  • 787
  • 1,044
Condrum
  • 63
  • 2
  • 11

1 Answers1

2

UIViewAnimationCurveEaseIn is not a valid value for the animateWithDuration method. You presumably intended UIViewAnimationOptionCurveEaseIn (note the Option in the constant name).

See UIViewAnimationOptions for a list of values to be used in conjunction with animateWithDuration. That constant you've used is intended for use with a different method.

Thus:

[UIView animateWithDuration:0.5 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{
    [pea setFrame:CGRectMake(82, 224, 35, 35)];
} completion:NULL];
Rob
  • 415,655
  • 72
  • 787
  • 1,044