user3814765
user3814765

Reputation: 9

Image view animation

I have a animation assigned to the uiimageview with the following code

 Fire.animationImages = [NSArray arrayWithObjects:
                            [UIImage imageNamed:@"firework1.png"],
                            [UIImage imageNamed:@"firework2.png"],
                            [UIImage imageNamed:@"firework3.png"],
                            [UIImage imageNamed:@"firework10.png"],nil];

    [Fire setAnimationRepeatCount:0];
    Fire.animationDuration = 0.5;
    [Fire startAnimating];

I want the animation to stop when it reaches 0.5 I tried a if statement but it didn't work. Please help.

Upvotes: 0

Views: 87

Answers (1)

Andr3wHur5t
Andr3wHur5t

Reputation: 56

According to the UIImageView documentation setting the animation repeat count to 0 will make it repeat indefinitely, try using [Fire setAnimationRepeatCount:1]; instead.

Upvotes: 1

Related Questions