Home
Copyright Max Johnson, all rights reserved.
A customizable UIScrollView for lazy loading multiple images. Useful for quickly loading views that contain images loaded from the web. Very simple to add to your application and style to your application look and feel.
Functionality
When the application loads, activity indicators are shown where images are being downloaded. Once the images are downloaded they will replace the loading indicators.
Clicking on an image will load that image on top of UIScrollView.
Create a controller that implements ScrollLazyloadViewController.
In addition, the following classes must be implemented:
Implement ImageLazyLoadDelegate and create the properties included in ScrollLazyloadViewController.h :
@interface ScrollLazyloadViewController : UIViewController
Modify objClsImgs.strURL in -(void)loadScrollImages to point to your images.
-(void)loadScrollImages function will add all objects of ClsImgs to Array and then It will set UIScrollView using -(void)setImageScrollView function.
In -(void)setImageScrollView, you can edit width and height of LazyLoadView using xPos += 68; and [scrollView setContentSize:CGSizeMake(xPos, 62)]; where 68 and 62 is width and height respectively.
For this you should have to change in your LazyLoadView.xib file accordingly in width or height.
ImageDownloader.h/m are used to download image using NSURLConnection. where we are passing objClsImgs.strURL for NSURLRequest in NSURLConnection.
- (void)loadImages checks for each image, if it is downloaded or pending.
If Images are not downloaded then It will call - (void)startIconDownload:(ClsImgs *)pClsImages forImgTag:(NSInteger)pImgTag.
After images are downloaded, - (void)appImageDidLoad:(NSInteger)pImgTag is called - use that for post load operations.
Copyright Max Johnson, all rights reserved.
Questions & Comments
Leave a comment
Log-in now or register for a free account.
9 months ago
9 months ago
9 months ago
11 months ago
1 year ago