Following suggest how to lazyloading in iOS Development
Download SDWebImage SDK :-
Unzip this folder and add all files from SDWebImage folder to your project.
When you add the
SDWebImage
folder in your project then select following option. To add copy of your folder to the destination project and Create groups.and then you have to write just like
#import "UIImageView+WebCache.h"
and call the this method:-[self.imageView sd_setImageWithURL:[NSURL URLWithString:"yoururl.png"] placeholderImage:[UIImage imageNamed:@"placeholder.png"]];
It provides:
- An UIImageView category adding web image and cache management
- An asynchronous image downloader
- An asynchronous memory + disk image caching with automatic cache expiration handling
- Animated GIF support
- A background image decompression
- A guarantee that the same URL won't be downloaded several times
- A guarantee that bogus URLs won't be retried again and again
- A guarantee that main thread will never be blocked
- Performances!
No comments:
Post a Comment