JulianB
JulianB

Reputation: 1686

UIViewAnimation causes Implicit conversion from enumeration type

I'm getting this warning

Implicit conversion from enumeration type 'UIViewAnimationCurve' to different enumeration type 'UIViewAnimationTransition'

from the last line in this code

if (((UIView*)[[slideViews subviews] objectAtIndex:0]).frame.origin.x > SLIDE_VIEWS_MINUS_X_POSITION) {
    UIView* tempRight2View =[[slideViews subviews] objectAtIndex:[[slideViews subviews] count]-1];
    [UIView beginAnimations:@"ALIGN_TO_MINIMENU" context:NULL];
    [UIView setAnimationTransition:UIViewAnimationCurveEaseInOut forView:viewAtLeft cache:YES]; 

I'm adapting code from StackScrollView, any know how to "explicitly" convert?

TIA

Upvotes: 2

Views: 3853

Answers (2)

bshirley
bshirley

Reputation: 8357

All enums are integers.

The method your calling takes a UIViewAnimationTransition.

+ (void)setAnimationTransition:(UIViewAnimationTransition)transition 
                       forView:(UIView *)view 
                         cache:(BOOL)cache;

you're setting it to one of the values defined by UIViewAnimationCurve.

Upvotes: 0

you are using a different set of enum: there you must put one of the UIViewAnimationTransition

typedef enum {
UIViewAnimationTransitionNone,
UIViewAnimationTransitionFlipFromLeft,
UIViewAnimationTransitionFlipFromRight,
UIViewAnimationTransitionCurlUp,
UIViewAnimationTransitionCurlDown} UIViewAnimationTransition;

while you are using one of UIViewAnimationCurve:

typedef enum {
UIViewAnimationCurveEaseInOut,
UIViewAnimationCurveEaseIn,
UIViewAnimationCurveEaseOut,
UIViewAnimationCurveLinear} UIViewAnimationCurve

they are still all integer but from different groups of constants

Upvotes: 1

Related Questions