O'Reilly logo

Mastering iOS 10 Programming by Donny Wals

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

Discovering slow code

Whenever you find that your app is slow or choppy, chances are that something in your code is taking longer than it should. Especially if your memory usage appears to be within reasonable numbers. If your app uses less than 50MB, memory is not likely to be an issue for you so seeking the problem in your code makes a lot of sense.

To profile our code, we need to profile our app by either selecting Product | Profile in the toolbar or by pressing cmd + I. To figure out what our code is doing, we need to select the Time Profiler template. This template will measure how long certain blocks of code cumulatively run.

To record a profiling session of our app, make sure that a device is connected to your Mac and make sure that it's ...

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