O'Reilly logo

iOS 9 SDK Development by Janie Clayton, Chris Adamson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Do-It-Yourself Concurrency

Actually, our app isn’t as fast as we might like. Try scrolling the table. The scrolling is still choppy. This has been the case since way back in Custom Table Cells, where we started fetching the avatar images from their URLs. So let’s think about what’s causing the problem and whether we can fix it.

When the table asks us for a cell—in tableView(cellForRowAtIndexPath:)—we can easily set all the labels with strings from the ParsedTweet, but what we have for the avatar image is an NSURL. So we stop and load the data for that URL, make a new UIImage from it, and assign that to our custom cell’s UIImageView. This has to happen for each cell. Moreover, we can only work on one cell at a time. As a new cell comes into ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required