The Grand Tour of iOS Architectures

The Grand Tour of iOS Architectures

Presented at iOSCon 2017 in London.

Video and more detail here: http://cutting.io/posts/the-grand-tour-of-ios-architectures/

Join Dan on this grand tour and discover the plethora of iOS software architectures popping up, from VIPER, VIP and Clean to Flux, Redux and Reactive. Along the way Dan will highlight the common themes and look at some real case studies, to get to the essence of what architecture is and why you should think about it for your app.

94fc7b58c03a0650fe1e8d78140bd451?s=128

Dan Cutting

March 30, 2017
Tweet

Transcript

  1. The Grand Tour of iOS Architectures Dan Cutting Schibsted cutting.io

    @dcutting
  2. The Grand Tour of iOS Architectures Dan Cutting Schibsted cutting.io

    @dcutting
  3. @dcutting

  4. @dcutting

  5. @dcutting MVC

  6. @dcutting

  7. @dcutting

  8. @dcutting ✓ Read/update views ✓ Convert taps into actions ✓

    Decide when to route ✓ Present/dismiss screens ✓ Inject dependencies ✓ Feature logic ✓ Talk to external systems ✓ Parse data ✓ Read/update models ✓ Domain logic ✓ Format data for the view ✓ Respond to other VCs
  9. @dcutting ✓ Read/update views ✓ Convert taps into actions ✓

    Decide when to route ✓ Present/dismiss screens ✓ Inject dependencies ✓ Feature logic ✓ Talk to external systems ✓ Parse data ✓ Read/update models ✓ Domain logic ✓ Format data for the view ✓ Respond to other VCs
  10. @dcutting Alex Proimos (CC BY-NC 2.0) https://www.flickr.com/photos/proimos/4199675334

  11. @dcutting Eutouring (CC BY-SA 4.0) https://commons.wikimedia.org/wiki/File:Flying_buttresses_of_the_Notre_Dame.jpg

  12. @dcutting Eutouring (CC BY-SA 4.0) https://commons.wikimedia.org/wiki/File:Flying_buttresses_of_the_Notre_Dame.jpg MVP

  13. @dcutting

  14. @dcutting

  15. @dcutting

  16. @dcutting Coordinator

  17. @dcutting override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if

    segue.identifier == "createLocation" { guard let creatorViewController = segue.destination as? CreatorViewController else { return } creatorViewController.delegate = self } }
  18. @dcutting

  19. @dcutting ✓ Read/update views ✓ Convert taps into actions ✓

    Decide when to route ✓ Present/dismiss screens ✓ Inject dependencies ✓ Respond to other VCs ✓ Format data for the view ✓ Feature logic ✓ Domain logic ✓ Read/update models ✓ Talk to external systems ✓ Parse data
  20. @dcutting

  21. @dcutting

  22. @dcutting View Controllers ✓ Read/update views ✓ Convert taps into

    actions Presenters ✓ Decide when to route ✓ Respond to other modules ✓ Format data for the view Entities ✓ Domain logic Interactors ✓ Feature logic ✓ Read/update models Routers ✓ Present/dismiss screens ✓ Inject dependencies Gateways ✓ Talk to external systems ✓ Parse data
  23. @dcutting View Controllers ✓ Read/update views ✓ Convert taps into

    actions Presenters ✓ Decide when to route ✓ Respond to other modules ✓ Format data for the view Entities ✓ Domain logic Interactors ✓ Feature logic ✓ Read/update models Routers ✓ Present/dismiss screens ✓ Inject dependencies Gateways ✓ Talk to external systems ✓ Parse data
  24. @dcutting Robert C. Martin https://8thlight.com/blog/uncle-bob/2012/08/13/the-clean-architecture.html

  25. @dcutting

  26. @dcutting

  27. @dcutting

  28. @dcutting

  29. @dcutting

  30. @dcutting

  31. @dcutting

  32. @dcutting

  33. @dcutting

  34. @dcutting 1. Testability

  35. @dcutting 1. Testability 2. A place for everything

  36. @dcutting 1. Testability 2. A place for everything 1. Philosophical

    disagreements
  37. @dcutting 1. Testability 2. A place for everything 1. Philosophical

    disagreements 2. Too much boilerplate
  38. @dcutting Lines of code 0 225 450 675 900 Number

    of types 0 3 6 9 12 15 18 MVC VIP
  39. @dcutting –Despondent respondent “It was terrible.”

  40. @dcutting Back home to Blighty

  41. @dcutting Back home to Blighty • Talk to your colleagues

  42. @dcutting Back home to Blighty • Talk to your colleagues

    • Piecemeal refactoring OK!
  43. @dcutting Back home to Blighty • Talk to your colleagues

    • Piecemeal refactoring OK! • Stop extracting when you’re happy with test coverage
  44. @dcutting Dan Cutting cutting.io @dcutting github.com/dcutting/GrandTour