How to debug UI Xcode?

Viewed 659

Got this runtime warning, how to get line where it happens?

runtime: UI API called from background thread: -[UIView bounds] must be used from main thread only

Is it any breakpoints i.e. symbolic breakpointfor this?

2 Answers

Main Thread checker has an option for pausing at the issue. You just need to enable it.

EditScheme->Run->Diagnostics->RunTime API Checking-> Select both Main Thread Checker and Pause On Issues

enter image description here

The answer by Puneet Sharma is good, but it has a downside: it requires Xcode 9. However, what you want is possible in earlier version as well, using symbolic breakpoints

Symbolic breakpoint

It works, but I noticed it makes the app run dramatically slow, so whenever possible, use Puneet Sharma's method

Related