I used to find a debug technique in an article, but I forget how to do it now. I describe it below and hope someone knows.
I remember that we can write some code anywhere such as in a ViewController's viewDidLoad.
override func viewDidLoad() {
super.viewDidLoad()
/*Some magic code here
Set a breakpoint here among these code
Some magic code here
*/
}
Then run the project in simulator. And when pressing the pause button in Xcode's debug area.It will jump to the breakpoint we set among the magic code directly.
Does anyone know how to do that?
PS: The magic code can be put in anywhere. And we can jump to the breakpoint in it when pressing pause button.