How to preload images in iOS

When you’re displaying a UIImage in your view controller it’s hardly noticeable how long it actually takes for the engine to “draw” the picture. Lenoard van Driel has tested this and confirms it takes 80ms – or in television terms, 2 frames. That’s something worth putting an audio delay in for.

Drawing several images in the same place takes a long time, and certainly takes the smoothness out of your UI. Once drawn however, iOS can display those images much quicker because they’re magically cached in memory – something we don’t have direct access to before you ask.

The solution is to “pre-draw” or “preload” those images while they’re not in vision. Leonard has written a method which does just that: