Lazy loading with UITableView + UIImage in Swift

Updated 25 November 2019

Save

Today I am going to show how to download an image from URL and manage the image cache.

Lazy loading is a design pattern commonly used in computer programming to defer initialization of an object until the point at which it is needed. It can contribute to efficiency in the program’s operation if properly and appropriately used. The opposite of lazy loading is eager loading.

Here I will show you an example where I will download and cached image in TableView.

Steps for lazy loading.

Step 1: Create an Image class where we will download an image and cached.

Steps 2: Create an object for the ImageLoader class.

Step 3: Download images in cellForRowAt

Hope the above blog will help you to implement lazy loading in UITableview iOS using swift.

author
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home