From Problem to Solution
summary
Argues that a practical abstraction emerges from refactoring a messy network client into a request behavior protocol with four parts (additional headers, beforeSend, afterSuccess, afterFailure) implemented with Swift protocol extensions. Builds concrete behaviors—auth header, background task, network-activity counter—and a combine requests behavior that treats arrays as one. Result reduces singletons, makes code decoupled and reusable, and shrinks testing to two tests per behavior (header present or not), showing the refactor actually works.
AI-written summary · about
chapters (4)
related talks
37mGrowing a Joyful Codebase from Legacy Code
49mDelivering incrementally: lessons about breaking up complex features
28mThe Art of Functional State Management
40mMobiconf 2018: John Sundell, Swift by Sundell
44mSeparation of concerns: Refactoring view controllers live
19mThe Art of Functional State Management for iOS Apps
34mThe Art of Functional State Management
35mThe Multi-Threaded Asynchronous Parallel World of Swift
