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!
SAVE 50% To celebrate WWDC23, all our books and bundles are half price, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.
The 100 Days of Swift is a free collection of videos, tutorials, tests, and more to help you learn Swift faster. Click here to learn more, or watch the video below.
Link copied to your pasteboard.