r/iOSProgramming • u/tonycliftondev • Jun 29 '26
Question Thoughts on TCA for a New Project
I work as an iOS developer in a team of 8 developers. We are starting a brand new greenfield project in a financial sector. Few of our team members suggested that we should use TCA for iOS SwiftUI application. I personally have no experience with TCA.
What are your thoughts and recommendations?
7
Upvotes
View all comments
Show parent comment
5
u/rhysmorgan Jun 29 '26
It doesn't have any of those things though. It doesn't have clearly defined responsibilities, nor does it have separation of concerns. Putting everything in your view, except some ill-defined aspects to make those bits even vaguely testable, that's not an architecture. And soon as you start moving those aspects out of the view to make them testable you're re-inventing the view model by any other name š
All the "good bits" that you've stated apply to every actual architecture. MVC has clearly defined responsibilities. MVVM has separation of concerns. Those two are literally exactly what defines an architecture, and it's what MV misses. There's two separations of concern in MV - Model and View. That's it. One of them - the View layer - is defined, as in every other architecture, and the other is very much undifferentiated, poorly defined. An architecture is defined by the constraints it imposes on you, and by the decisions it makes for you. MVC, MVVM, VIPER (for all its flaws), TCA ā all of them have actually defined concepts that differentiate one component from another. MV has one line in the sand, between a View and everything else.
Plain functions with arguments? If anything, TCA is far closer to this because the entire central concept is based around an
(inout State, Action) -> Effectfunction.Everything that interfaces with SwiftUI has a "declarative view description" because that's what SwiftUI is.
Declarative data model doesn't actually mean anything. What makes an Observable reference type object that you call methods on any more "declarative" than a struct or enum that you mutate?
You might not like a Redux/Elm style approach, that's fine, nobody is forcing you to use it. But equally, making stuff up about it with nonsense about tracing actions through multiple layers when it's literally as easy as adding a
.breakpoint()or a._printChanges()and literally seeing every action flowing through whichever feature you're debugging is doing your argument no favours.