Separation of concerns: Refactoring view controllers live
summary
Live refactoring of a Swift app converts a 73-line view controller into 32 lines by extracting concrete pieces: a Bundle extension for JSON decoding, an attributed-title computed property moved into the Project model, a reusable ProjectDataSource class, a DetailView UIView subclass with a closure-based readAction, a NavigationDelegate for WKWebView plus a WKWebView URL-loading extension, and a MainCoordinator that boots the app (removes storyboard) and calls MainCoordinator.start(). All pieces compile and run live, demonstrating smaller, testable modules.
AI-written summary · about
chapters (14)
- 0:00Introduction and speaker intro
- 2:25MVC problems and talk overview
- 9:54Live coding project setup
- 10:15Extracting bundle decoding logic
- 14:11Moving attributed string formatting
- 15:56Creating reusable table data source
- 20:13Refactoring view creation to UIViews
- 26:10Extracting WebKit navigation delegate
- 29:06Adding URL loading extension
- 31:13Introducing coordinator pattern
- 36:37Implementing coordinator protocol
- 39:29Making view controllers storyboardable
- 40:39Integrating coordinator with view controllers
- 42:06Summary and refactoring benefits








