Johnny Rockex
Johnny Rockex

Reputation: 4196

Accessing typedef enum by the number?

I would like to access a UIViewAnimationTransition by its corresponding number (please see image, number 1.). Also, what does the second number correspond to (image, number 2) and is it relevant to accessing the first. Something like this below, where option is defined quickly and then e.g. fed into an animation block.

UIViewAnimationOptions option = 3; //  UIViewAnimationOptionTransitionCurlUp    

    UIImage * toImage = [backgroundImages objectAtIndex:backgroundImageCount];
    [UIView transitionWithView:backgroundView
                      duration:transitionDuration
                       options:option
                    animations:^{
                        [backgroundView setImage:toImage];
                    } completion:nil];

enter image description here

Upvotes: 0

Views: 173

Answers (1)

David Rönnqvist
David Rönnqvist

Reputation: 56635

Those are bit shifted values. For example 1<<20 is equal to 1048576. You can calculate them in Spotlight if you need them

enter image description here

That said, you shouldn't reference them by their numbers.

Upvotes: 1

Related Questions