~/talk

Unit Testing Storyboard Segues

Talkat /dev/world 2019 · 2019-09-26..09-27· [testing]
links:none on file
slides:none on file

Shows how to unit test storyboard segues in Swift by replacing UIViewController present implementations with a runtime method swizzling spy that posts notifications and captures the presented view controller, letting tests assert the presented VC type and passed model data. Uses key‑value coding to inspect segue templates for table cells and gesture recognizers, simulates taps by selecting rows or triggering performSegue, pumps the run loop during teardown, and keeps all changes inside the test target so there are no production code changes.

AI-written summary · about

  1. 0:00Introduction
  2. 1:28Why test storyboard segues
  3. 2:52What happens during a segue
  4. 4:37Challenges in testing segues
  5. 7:10Implementing the swizzle spy
  6. 9:19Setting up the test spy
  7. 11:15Testing segue existence
  8. 13:24Accessing segues from table cells
  9. 14:13Testing gesture recognizer segues
  10. 15:37Testing table row segues
  11. 16:24Summary and acknowledgments
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.