Today you’ll be starting a technique project that is entirely unlike everything we’ve done so far. You see, rather than you coding along with me as we build an app from scratch, I’ve already written an app for you.
Sounds good, right? Well, hold up: while this app is vaguely useful, it has some really deep problems. If you try running it on a real device you’ll find it’s extremely slow and likely to crash. If you run in the simulator it will be much less likely to crash, but it will still be equally slow.
In this chapter we’ll be looking at how Xcode, the Simulator, and a dedicated tool called Instruments can help us find and fix performance issues in code. While it’s unlikely you’ll ever see a project that has all of these problems, you will definitely hit them all at some point.
These problems don’t occur because folks are lazy or ignorant. In fact, as Edsger Dijkstra once said, “if debugging is the process of removing software bugs, then programming must be the process of putting them in.” In short, problems are a normal part of the process, so it’s time for you to learn the skills necessary to find and fix them.
Today you have five topics to work through, and you’ll learn about using the Time Profiler and Allocations instruments, how to draw shadows in both Core Graphics and
CALayer, re-using table view cells in code, and more.
Need help? Tweet me @twostraws!
SPONSORED Catch bugs as soon as they happen and know exactly why a crash occurred. Instabug's SDK grabs all the logs they need to fix bugs, crashes and performance issues in minutes instead of days. Get screenshots, device details, network logs, repro steps, and tons of other critical insights needed to resolve issues and prioritize product backlogs straight from your dashboard. It only takes a minute to integrate!
Link copied to your pasteboard.