December 2016
Intermediate to advanced
416 pages
15h 21m
English
The simplest debugging uses the console. Interpreting the information provided in the console when an application crashes or intentionally logging information to the console allows you to observe and zero in on your code’s failures. Let’s look at some examples of how the console can support your quest for bug-free code.
Time to add some mayhem to the Buggy project. Suppose that after considering the UI for a while, you decide that a switch would be a better control than a button. Open ViewController.swift and make the following changes to the buttonTapped(_:) method.
@IBAction func buttonTapped(_ sender: UIButton) {@IBAction func switchToggled(_ sender: UISwitch) { print("Called ...
Read now
Unlock full access