AAAlexandre Alcuvillainswiftuicentral.com·22h ago · 8 min readTest-Driving a Cache Layer in SwiftUI In previous articles, we built a CachingFeedRepository by writing the implementation first and tests after. That works — but it leaves a subtle gap: the tests are shaped by the implementation you alre00
AAAlexandre Alcuvillainswiftuicentral.com·May 8 · 8 min readSingle Responsibility: Breaking Up Fat ViewModels in SwiftUIThe Single Responsibility Principle (SRP) states that a class should have one reason to change. It's the first letter of SOLID, and arguably the one most frequently violated in SwiftUI projects. The c00
AAAlexandre Alcuvillainswiftuicentral.com·May 2 · 7 min readApplying 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 wor00
AAAlexandre Alcuvillainswiftuicentral.com·Apr 22 · 8 min readClean 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, JS00
AAAlexandre Alcuvillainswiftuicentral.com·Apr 21 · 5 min readDependency 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, 00