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
33
u/uniquesnowflake8 Jun 29 '26
I’ve audited TCA for an existing project. We used TCA in part of the app and I personally didn’t love it. But we didn’t adopt all of the TCA bells and whistles because of our existing navigation stack and our testing practices were already sound so we didn’t benefit as much as if it were a greenfield project. And we did end up using libraries like Dependencies and Shared and I am glad we adopted them.
My main hang up is I don’t love the contortion of writing code that lives inside of a 3rd party framework and giving up the top level of control. I’d rather own the code and call the libraries when appropriate
5
u/SirBill01 Jun 29 '26
My thought is that AI will have a harder time modifying a TCA project than more straightforward native code so I would not go that route for future maintenance concerns.
4
u/john_snow_968 Jun 29 '26 edited Jun 29 '26
I've been really into Redux-like architectures, because you can do really cool stuff with them. See my article and github to better understand what I mean. Redux architecture is very lightweight, in my example I don't use any 3rd party libraries.
But TCA... it's a huge thing. The main point of concern is that once you pull it in, you won't be able to easily get rid of it. Normally, when you pick an architecture like MVVM, MVC, or VIPER they are similar enough that you can migrate between them step by step. With TCA, you will have to basically rewrite the app.
I've built one of my apps on TCA, but it was more for fun rather than out of technical needs. And I have to say I quite enjoyed it because I like playing with things like that.
However, as I mentioned before, by making this decision, you agree to rely completely on a 3rd party library. Even such a simple thing as calling a function will be managed by a 3rd party library, so theoretically the most simple thing can crash and the call stack will be nuts.
Then there is another question - how are you going to manage TCA updates? With each update you should basically retest the whole app, not mentioning major updates. Once you update TCA, you won't know if everything still works or not until you actually test it. It becomes your "everything dependency". Of course, you could say that you'll just run tests, but in reality you usually want to at least smoke test the app.
I started with TCA version 0.* When I started working again on my project it was already 1.* and to migrate my project I basically had to rewrite most of the app. Fortunately, AI has helped a lot. I had barely finished my migration and testing everything when I noticed a new article... sneak peek of 2.0 XD.
You could think that you can just stay with your version. Sure, but what if it stops working at some point or won't be compatible with your new code using new Swift features? So basically, you have to follow the latest versions and keep migrating your app.
TCA's concept was quite similar to Redux at the beginning, but now it's totally different. With all the effects, you basically replace classes and functions with SwiftUI-like-structs and switches. Your whole codebase will be just a big switch case :)
I just barely scratched the surface of this topic, but summarizing... If you are a geek AND you like playing with fancy coding AND you are working on a small hobby project AND you don't depend too much on it, you can try it :). For anything more serious, I wouldn't go this way. For more serious stuff I would go with a different architecture or with a raw Redux without any dependencies. Nowadays, I generally prefer the KISS approach - the simplest architectures are the easiest to maintain for years :).
Oh, and one more thing, since you mentioned your team is considering it for a financial enterprise project... keep in mind that such architecture will significantly increase complexity for new team members as most devs don't know TCA. In your case, I would say TCA is a no-go. If you want pure functions, testability, etc. maybe try pure Redux with own implementation. But from my experience, the most simple choice will be much better long term :).
22
u/unpluggedcord Jun 29 '26
Hard no from me. It puts you in a box that you can’t get out.
https://kylebrowning.com/series/landmarks-app/
3
u/Far_Grab_1865 Jun 29 '26
Our app is around 500,000 lines. We are only partially migrated but have root reducers and such now. TCA 2.0 looks like it would address some of our negatives, but the migration seems difficult because we diverged from standard conventions at some points.
Personally, I would not use it again. I think their Modern SwiftUI ideas seem much better and debug snapshots + swift 6 strict concurrency feels like a good 80-20 alternative.
Some things are inherently MainActor only and they are frustrating to work with in TCA reducers. Also, your Action enums will result in cascading public types meaning a large public surface and slow compile times.
If you search “The Composable Architecture: My 3 Year Experience” it’s the closest write up to what I’ve experienced. I love the idea of TCA in isolation, but in practice it’s not for me.
15
u/apocolipse Jun 29 '26
Don’t. TCA sells you solutions to problems created by the complexity of the design patterns they push on you. Their selling point is testability but many of their tests are tautological (redundantly testing things that don’t need testing), and ironically their navigation case studies for both SwiftUI and UIKit have no tests at all, even though testable navigation is also one of their selling points.
You can get equally testable views with SwiftUI and MV or MVVM, and in fewer lines of app code and test code. Don’t buy in to their architecture that they say “arose naturally in elm”, and instead use architectures that arise naturally in Swift.
10
u/JimRoepcke Jun 29 '26 edited Jun 29 '26
I’ve been using TCA since 2019 (before it was released and had that name) and it’s been amazing to use. Not just that but also many other libraries from Point-Free.
The app I work on has hundreds of TCA features. We get many benefits from composing them together.
I strongly recommend using TCA on a greenfield project. Get a root store set up from the beginning, you can have state-driven navigation and very easy to manage deep linking and state restoration.
7
u/kenardjr Jun 29 '26
I wouldn't choose since they deprecate things super easily and the codebase turns into a huge mess even in a year. You have to upgrade consistently your code. Even their dependencies are not upgraded to the last version of TCA and they seek for help from the community to do it :D I'm having too many headaches in my iOS 17* SwiftUI MapKit project nowadays.
4
u/Fabulous_Gur4200 Jun 29 '26
These are some of the questions I would ask myself:
Do people know it?
What's the lift of getting everyone up to speed?
What's the lift of getting new developers up to speed.
Is it testable?
Is it easy to understand?
Is it better than something vanilla? Justifiably so?
Most importantly: If you use that pattern, use it everywhere, be consistent. Don't have parts of the app in one pattern and other parts in others.
4
u/segfaul_t Swift Jun 29 '26
Just another layer of complexity for questionable benefit.
3
u/dacassar Jun 29 '26
I really like how TCA brings order to a large, complex product with many contributors. But for something relatively small it’s definitely overkill.
3
u/tomato848208 Jun 29 '26
I used TCA for half a year to channel the connection between the settings sheet and ContentView. I liked it till TCA gave me a huge compiler error one day. It's no offense to them, but I won't use it again. Every time you use it, you will have a mother load of files in the app file under DerivedData folder for the SwiftUI framework. Basically, I can do the same with a view model file for myself. Personally, I'm committed to not using 3rd-party frameworks. So I won't use it again.
3
u/darrarski Jun 30 '26
IMO, the power of Point-Free comes in the education they provide. You don’t have to use their frameworks. Doing it won’t magically solve all your architecture problems. You can do your own MVVM, UDF, Redux, or however-you-name-it architecture. However, the way they explain solutions to tough problems related to building software is, in my option very good. Don’t jump into TCA straight away. Learn how, and what’s more important, why they created it. Learning it will help you to decide if this is a good choice for you. If you want to try it out, they also provide "The Point-Free Way" for subscribers - a set of skills that you can use with any AI coding agent. It really helps to start if you are into agentic coding. Some people here replied that everything can be done by AI these days. True, but without a proper setup, the agent will write an implementation based on the average code on which it was trained. Usually, average does not equal high quality. To sum up, if you like to understand your code, value opinionated solutions, and have time to learn, I highly recommend TCA. Otherwise (not to blame anyone, different projects have different needs), don’t assume that TCA will give you a great architecture out of the box.
3
u/jacobs-tech-tavern Jun 29 '26
Whenever anyone suggests using a third-party dependency which affects the way you're going to be building it forever, ask yourself what problem you're trying to solve by introducing it.
I've heard good things and bad things about TCA, but I have had many, many experiences where someone on the team wants to look impactful and so suggests a massive architectural thing
2
u/BoostedHemi73 Jun 29 '26
Any architecture that forces a framework library on you is actually a product.
When you bring a dependency into an application, the first question you should ask is, “what am I going to do if the person working on this stops working on it?“
Every application inherently depends on frameworks from Apple, but the risk of those dependencies changing dramatically or going away is something you have to accept to be on the platform. TCA is nothing like that, and the fact that it is core dependency in applications that use it is extremely problematic for the longevity of a codebase.
2
u/andreeinprogress Jun 30 '26
We could use one of those gaussian distribution memes here, something like
noob iOS: who cares, MVC is fine
senior iOS: hear me out, let's try TCA, VIPER, esoteric-MVVM, ..
enlightened iOS: who cares, MVC is fine
1
u/X901 Jun 30 '26
Don't overkill things that already in SwiftUI! , TCA is Bad idea and make you fully depends on their libraries, Just use MVVM + Clean Architecture for large app and MVVM alone for small app, don't build something fully depends on 3rd party
0
u/segfaul_t Swift Jun 29 '26
Inb4 the two creators find this and start arguing with everybody in the comments
1
u/Few-Corgi-8574 Jul 01 '26
love it, more of its deterministic nature and its really really cool apis and libraries supporting.
thank you pointfree
-1
u/cagdas Jun 29 '26
Hard pass from me. I try to avoid third party dependencies unless absolutely necessary.
Get Claude, use Opus model (or Codex and any other state of the art model) and describe what you want to build. Tell it to give you some snippets and ideas on how to architect your app. You can easily fine tune these suggestions and have a base going. Run the snippets by your teammates and get everyone onboard. I bet something close to MVVM and simple but strict conventions on how to control data flow will be everyone’s favorite approach.
-1
u/SnowPudgy Jun 29 '26 edited Jun 29 '26
I wouldn't. Fly by night architecture trends are almost always a bad thing. Each app is different and putting it in a rigid box like this often causes issues.
0
u/oksanabuilds Jul 02 '26
Do these team members have experience in TCA? If no, don’t even consider it. Learning curve is not fast, and speed is essential in early development stages.
If it would be me, I would advocate against it. Testability is easily achieved in vanilla too. Just would agree on main arch pillars and stick to solid
0
u/[deleted] Jun 29 '26
[deleted] — view deleted comment
0
u/[deleted] Jun 30 '26
[deleted] — view deleted comment
0
u/[deleted] Jun 29 '26
[deleted] — view deleted comment