Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Testing UIViewControllers

Testing UIViewControllers

Slides from lightning talk given 10/22 @ Swift Language User Group

Rachel Bobbins

October 22, 2015
Tweet

More Decks by Rachel Bobbins

Other Decks in Programming

Transcript

  1. Motivation Why do I care? Why should you care? The

    UIViewController controls the user’s experience.
  2. Motivation Why do I care? Why should you care? The

    UIViewController controls the user’s experience. It should be a good one.
  3. Motivation Why do I care? Why should you care? The

    UIViewController controls the user’s experience. It should be a good one. (Don’t you think so?)
  4. Example Dependency: Dialog Presenter!!! Tip #3: Use protocols. If a

    view controller needs it, it needs conform to a protocol
  5. Example Dependency: Dialog Presenter!!! Tip #4: Invest in fakes. Boolean

    properties keep track of which methods were called
  6. Example Dependency: Dialog Presenter!!! Tip #4: Invest in fakes. Boolean

    properties keep track of which methods were called Tuple properties keep track of the arguments
  7. FYI + Resources - Demo code is on GitHub: https://github.

    com/rbobbins/earthquake-counter - PivotalCoreKit has useful helpers for simulating interactions (i.e - tap) https://github. com/pivotal/PivotalCoreKit/tree/master/UIKit/SpecHelper/E xtensions