The Composition Root Pattern in SwiftUI AppsEvery article in this series has ended with the same instruction: wire everything at the Composition Root. We've used it as the place where RemoteFeedRepository meets CachingFeedRepository, where UserJun 29, 2026·8 min read
Applying the Decorator Pattern in SwiftUI to Add Caching Without Changing Existing CodeYou've built a clean feed feature. The RemoteFeedRepository fetches items from the network, the LoadFeedUseCase runs the business logic, and the ViewModel drives the view. Everything is tested and worMay 2, 2026·7 min read
Clean Architecture in SwiftUI: Separating Domain, Data, and PresentationMost SwiftUI apps start simple. A ViewModel fetches data from an API, maps it to a model, and drives a view. It works. But as the app grows, the ViewModel becomes a god object: it knows about URLs, JSApr 22, 2026·8 min read
Dependency Injection in SwiftUI: Composing Views Without SingletonsOne of the most common pitfalls in SwiftUI apps is the overuse of singletons and global state. It feels convenient at first — you just reach for UserDefaults.standard, a shared NetworkService.shared, Apr 21, 2026·5 min read
SwiftUI - Decoupling ModelsProblem: How can we avoid breaking an entire app when a model changes? Solution: Decouple each model based on their specific domain. A Deeper Dive When working with data from various sources, a common challenge developers face is the potential for e...Sep 13, 2023·9 min read
SwiftUI - TDD actor to avoid race conditionProblem: How to avoid threading race conditions in your class? Solution: Use actor that handles all the concurrency for you! Code that runs synchronously is easy to manage and understandBut when start introducing threads, problems occurYou need to ma...Jan 12, 2023·4 min read
SwiftUI - TDD async/awaitProblem: How to TDD async/await ? Solution: Stub the response, async function needs to know it's result before call IMPORTANT: This tutorial is only available for iOS 15+It will use the async/await integration in URLSessionAnd the AsyncImage SwiftUI ...Oct 13, 2022·17 min read