Skip to content

Instantly share code, notes, and snippets.

@cellularmitosis
Last active July 12, 2020 00:45
Show Gist options
  • Save cellularmitosis/5fa73d2ba8b987e31a1c02e287837822 to your computer and use it in GitHub Desktop.
Save cellularmitosis/5fa73d2ba8b987e31a1c02e287837822 to your computer and use it in GitHub Desktop.
Populating UITableViewCells Asynchronously to Maintain Scrolling Performance

Blog 2015/9/25   (retroactively blogged on 2020/6/11)

<- previous | index | next ->

Populating UITableViewCells Asynchronously to Maintain Scrolling Performance

In general, the key to keeping the iPhone UI responsive is to avoid blocking the main thread. In the case of UITableView, this boils down to keeping tableView(_:cellForRowAtIndexPath:) as performant as possible.

However, sometimes it is simply not possible to marshall all of the data needed to populate a complex UITableViewCell without causing a drop in framerate. In these cases, it is necessary to switch to an asynchronous strategy for populating UITableViewCells. In this article we explore a trivial example of using this technique.

See https://github.com/pepaslabs/GlitchyTable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment