Follow along at https://www.hackingwithswift.com/100/65.
This day covers the second and final part of
Project 18: Debugging
in Hacking with Swift.It focuses on extending our debugging exploration with a set of challenges.
Temporarily try adding an exception breakpoint to
project 1
, then changing the call toinstantiateViewController()
so that it uses the storyboard identifier “Bad” – this will fail, but your exception breakpoint should catch it.
- 🔗 Commit
- 📸
In
project 1
, add a call toassert()
in theviewDidLoad()
method ofDetailViewController.swift
, checking thatselectedImage
always has a value.
- 🔗 Commit
Go back to
project 5
, and try adding a conditional breakpoint to the start of thesubmit()
method that pauses only if the user submits a word with six or more letters.