Best approach for Image loading in iOS apps
Best way to load Images in iOS apps than image sync.
Download SDWebImage framework and Unzip it.
**Steps to follow**:-
Step 1. Add SDWebImage framework into your project. On Project navigator Click>>Project then
Step 2. Click >> Target >> Build Phases.
Step 3. Click>> Link Binary with Libraries.
Step 4. Click >> '+' button.
Step 5. Click Add other
Step 6. Select SDWebImage folder.
Step 7. In your xcode file include framework
#import <SDWebImage/UIImageView+WebCache.h>
Step 8.
[imageView setImageWithURL:[NSURL URLWithString:imageURL objectAtIndex:indexPath.row]] placeholderImage:[UIImage imageNamed:@"placeholder.png"]];
Incase you want to refresh or reload images then execute the below code...
[[[SDWebImageManager sharedManager] imageCache] clearDisk];
0 Comment(s)