Hold up your right hand and repeat after me: "I will never ship an app without running it through Instruments first." It doesn't take long, it's not difficult, and I promise it will pay off – your user interfaces will be smoother, your code will run faster, and you'll avoid wasting memory, all using a tool that's completely free and you already have installed.
I have, predictably, only touched briefly on the many features of Instruments here, but I hope I've inspired you to learn more. Instruments can tell you exactly what each CPU core is doing at any given time, it can tell you when every object was created and when it was destroyed along with what code triggered it, and it can even simulate user interface interactions to help you stress test your apps!
At the same time, I also snuck in a few more techniques for you to try in your own apps – layer shadows, Core Graphics clipping, and timer invalidation, plus how
UIImage has an automatic cache for when you need it.
So: all in all another great technique project, and you’ve learned some great skills that will be useful in every iOS project you make from now on.
You finished another project, and I'm glad Hacking with Swift helped you. Now I need your help. Please take just a moment out of your day to tell others about Hacking with Swift so they can benefit too.
You can click below to post a tweet straight to this project. Or if you're feeling particularly generous, you can click here to link to Hacking with Swift on your website and help spread the word.
Thank you. Your support is what keeps me going!
Paul Hudson is the creator of Hacking with Swift, the most comprehensive series of Swift books in the world. He's also the editor of Swift Developer News, the maintainer of the Swift Knowledge Base, and Mario Kart world champion. OK, so that last part isn't true. If you're curious you can learn more here.
Help support Hacking with Swift
This site is funded by Hacking with Swift supporters who buy my e-books. If you can, please support my work – it comes packed with bonus material!