April 2026
Intermediate
683 pages
25h 29m
English
Browsing through the code and stepping in and out of subroutines might be enough to debug simple cases, but sometimes you’ll wish you had more options. Xcode offers powerful advanced debugging tools that will help you debug faster and smarter in difficult codebases. In this section, we will introduce some of those tools.
A conditional breakpoint only stops execution if a specific condition is true. This technique is really useful when you want the app to mostly execute as normal and stop only in an exceptional scenario worth inspecting.
Check the code sample in Listing B.2, in which the app attempts to connect to a resource 300 times.
func attemptConnecting(maxTimes: Int) { for ...
Read now
Unlock full access