0

I have a UITableView with images like photo album, images are loading with lazy loading. I want to load more images while scrolling to the bottom of the tableview or when the last row of the table view reached. How can I do this?

Toon Krijthe
  • 52,876
  • 38
  • 145
  • 202
Dev
  • 3,885
  • 10
  • 39
  • 65

3 Answers3

0

UITableView already does lazy loading for you. It will only ask for the visible cells. If you are taking about adding more images to the table while the user is scrolling, you can implement UIScrollViewDelegate methods to calculate the current scrolling position, and when the user reaches certain point, add more images to the NSMutableArray on your datasource.

J2theC
  • 4,412
  • 1
  • 12
  • 14
0

You can use SDWebImage.

This library provides a category for UIImageVIew with support for remote images coming from the web.

It provides:

  1. An UIImageView category adding web image and cache management to the Cocoa Touch framework

  2. An asynchronous image downloader

  3. An asynchronous memory + disk image caching with automatic cache expiration handling

  4. A guarantee that the same URL won't be downloaded several times

  5. A guarantee that bogus URLs won't be retried again and again Performances!

Siba Prasad Hota
  • 4,779
  • 1
  • 20
  • 40