Home > DeveloperSection > Forums > .gif files not reflecting delay changes in xcode project
lois waisbrooker
lois waisbrooker

Total Post:70

Posted on    June-04-2013 1:44 AM

 iPhone iPhone 

 1 Reply(s)
 1181  View(s)
Rate this:
Hi Expert,

I am using .gif files in my xcode project. I have replaced my gif with different time delays between frames. But it does not reflect the changes. The changes between frames have been done in gif itself. the preview of that .gif file shows the changes but on the simulator it does not reflect the same delay! 

Please help.
Thanks in advance. 


Total Post:604

Posted on    June-05-2013 8:31 AM

Hi Lois,

I can provide you with a simpler solution, you can inherit this library and then you simply have to add a single method that is

NSURL *url = [[NSBundle mainBundle] URLForResource:@"JuU08" withExtension:@"gif"];
[SharedImageButton setImageWithURL:[ImageArray objectAtIndex:indexPath.row] placeholderImage:[UIImage animatedImageWithAnimatedGIFData:[NSData dataWithContentsOfURL:url]]];
Where JuU08 is the name of the gif image that you have added to your project. Here I have added the image to a UIButton in a UITableView.

Link :- https://github.com/mayoff/uiimage-from-animated-gif

Instead of adding multiple frames with time delays which can become tiring . 

Hope this helps you.

Don't want to miss updates? Please click the below button!

Follow MindStick