Explain what considerations do you need when writing a UITableViewController which shows images downloaded from a remote server?

Submitted by: Muhammad
This is a very common task in iOS and a good answer here can cover a whole host of knowledge. The important piece of information in the question is that the images are hosted remotely and they may take time to download, therefore when it asks for “considerations”, you should be talking about:

☛ Only download the image when the cell is scrolled into view, i.e. when cellForRowAtIndexPath is called.
☛ Downloading the image asynchronously on a background thread so as not to block the UI so the user can keep scrolling.
☛ When the image has downloaded for a cell we need to check if that cell is still in the view or whether it has been re-used by another piece of data. If it's been re-used then we should discard the image, otherwise we need to switch back to the main thread to change the image on the cell.
Other good answers will go on to talk about offline caching of the images, using placeholder images while the images are being downloaded.
Submitted by: Muhammad

Read Online UX Designer Job Interview Questions And Answers