into my app I need to display gif image on my view, but don't use the UIWebview to display it. So have any way to do it? Thanks in advance!
Asked
Active
Viewed 1,496 times
-1
-
Have a look this :-https://github.com/arturogutierrez/Animated-GIF-iPhone – Rushabh Aug 14 '14 at 07:20
-
1Same Question here :- http://stackoverflow.com/questions/9744682/display-animated-gif-in-ios – Rushabh Aug 14 '14 at 07:20
2 Answers
2
check out this
https://github.com/mayoff/uiimage-from-animated-gif
It provides the following category:
+[UIImage animatedImageWithAnimatedGIFURL:(NSURL *)url]
allowing you to simply:
#import "UIImage+animatedGIF.h"
UIImage* mygif = [UIImage animatedImageWithAnimatedGIFURL:[NSURL URLWithString:@"http://en.wikipedia.org/wiki/File:Rotating_earth_(large).gif"]];

Sumit Mundra
- 3,891
- 16
- 29
2
You Can Use this project from gothub https://github.com/mayoff/uiimage-from-animated-gif
Example
NSURL *url = [[NSBundle mainBundle] URLForResource:@"test" withExtension:@"gif"];
self.dataImageView.image = [UIImage animatedImageWithAnimatedGIFData:[NSData dataWithContentsOfURL:url]];
self.urlImageView.image = [UIImage animatedImageWithAnimatedGIFURL:url];
url = [[NSBundle mainBundle] URLForResource:@"variableDuration" withExtension:@"gif"];
self.variableDurationImageView.image = [UIImage animatedImageWithAnimatedGIFURL:url];

BHASKAR
- 1,201
- 1
- 9
- 20
-
up vote for good link, So just have only answer is accept so this is must the earlier answer.Thanks for your help. – lee Aug 14 '14 at 09:13