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
SwiftUI - Extract navigation logic from SwiftUI views for testabilityProblem: How to test your navigation logic in SwiftUI ? Solution: Extract navigation logic in a separate Service that handles it using UIKit SwiftUI is very powerful tool, for UI creation and animationBut I really don't like the navigation logicThat ...Jun 21, 2022·20 min read
SwiftUI - Test drive the logic inside a view using TDDProblem: How test behavior inside a SwiftUI view ? Solution: Extract all the logic in a ViewModel and test drive only the behaviour using the TDD process ! You have this view to integrate Specs for this design look like this: - [ ] Display favor...May 30, 2022·16 min read
SwiftUI - Automate UI regressionProblem: How to automate regression on UI screens? Solution: Snapshot Tests ! SwiftUI and the Live Preview are a good matchThanks to them I was able to quickly build this view: The Live Preview is effective for creating viewsBut does not warn in cas...Apr 21, 2022·4 min read
SwiftUI - Integrate UI without a ready backendProblem: How to integrate UI with a not ready backend? Solution: By decoupling the model returned by the API from the model that manages the UI display ! Simple example with this interface inspired by the Message app: The row that displays a message ...Feb 16, 2022·6 min read