Skip to content

Instantly share code, notes, and snippets.

@FredericJacobs
Last active December 15, 2015 04:49
Show Gist options
  • Save FredericJacobs/5204090 to your computer and use it in GitHub Desktop.
Save FredericJacobs/5204090 to your computer and use it in GitHub Desktop.
How to make load animated GIFS into a UIImageView

Use the Image Magic Command

convert +adjoin loading.gif out%d.gif

Then load them using the animationImages in the UIImageView.

UIImageView* animatedImageView = [[UIImageView alloc] initWithFrame:self.view.bounds];
animatedImageView.animationImages = [NSArray arrayWithObjects:    
                               [UIImage imageNamed:@"image1.gif"],
                               [UIImage imageNamed:@"image2.gif"],
                               [UIImage imageNamed:@"image3.gif"],
                               [UIImage imageNamed:@"image4.gif"], nil];
animatedImageView.animationDuration = 1.0f;
animatedImageView.animationRepeatCount = 0;
[animatedImageView startAnimating];
[self.view addSubview: animatedImageView];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment