Pregunta

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?

¿Fue útil?

Solución

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];
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top