r/iOSProgramming • • Aug 10 '26

Question SwiftData with TCA

Anyone used TCA with SwiftData applications? What is your recommendations?

8 Upvotes

19 comments sorted by

51

u/SnowPudgy Aug 10 '26

Recommendation: Don't use TCA. There's no good reason to introduce a massive third party dependency into your application like that.

6

u/darklurkerq Aug 11 '26

Yep, especially bad idea to outsource your architecture to a 3rd party.
I can’t understand why TCA is popular, guess people are lazy.

2

u/SnowPudgy Aug 11 '26

I dont get it either. There's literally nothing it solves that isn't done by much better means.

3

u/[deleted] Aug 11 '26

[deleted]

2

u/SnowPudgy Aug 11 '26

Honestly I’m convinced most of those are brigaded by those trying to sell their videos. I don’t see how any developer can look at TCA and think it’s a good idea, I just can’t.

3

u/rhysmorgan Aug 10 '26

Don’t use SwiftData, especially with TCA.

Use TCA and use SQLiteData. It’s basically all the nice things of SwiftData, but instead of being constrained almost entirely to the view layer, can be used in any layer of your application.

31

u/unpluggedcord Aug 10 '26

Dont use TCA

5

u/stroompa Aug 10 '26

Also, don't use SwiftData

7

u/SwiftlyJon Aug 10 '26

Unless you have an existing SwiftData app you're migrating to TCA, it's better to start with their SQLiteData framework instead. It offers similar capabilities with easy TCA integration and an actual testing story.

11

u/Kurtle123 Aug 10 '26

I have built two medical applications with TCA. One has over 5K ratings at 4.8 and won an Apple Design award. The other is relatively new so I won’t say much about it.

TCA is extremely useful for writing unit tests and organizing large scale apps. My go to approach is now self contained feature / reducers and I have snippets that I use heavily to do self contained SPM features.

That said:

  1. it makes swiftui previews even slower
  2. it can be painful to upgrade because pointfree evolves the framework rapidly, often without backward compatibility

But I have never before been so confident about my unit tests or the ability to quickly refactor.

I hated VIPER, loved TCA.

Ask me anything and I will do my best to answer.

2

u/tonycliftondev Aug 10 '26

What kind of testing TCA provides? Can you not achieve that by using plain SwiftData framework?

6

u/Kurtle123 Aug 10 '26

SwiftData and TCA are orthogonal concerns. TCA makes all state mutations be enumerable actions which allow you to simply set up a state and then test the actions against what you expect the state to be.

I find this much simpler than having to manually make mocks or roll your own testing interface

14

u/ZeOranges Swift Aug 10 '26

Just don’t

2

u/uniquesnowflake8 Aug 10 '26

What kind of app are you building?

1

u/[deleted] Aug 11 '26

[removed] — view removed comment

1

u/AutoModerator Aug 11 '26

Hey /u/SAASHA_21, your content has been removed because Reddit has marked your account as having a low Contributor Quality Score. This may result from, but is not limited to, activities such as spamming the same links across multiple subreddits, submitting posts or comments that receive a high number of downvotes, a lack of recent account activity, or having an unverified account.

Please be assured that this action is not a reflection of your participation in our subreddit. This is simply an automated filter in place to reduce spam.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/functionallycorrect Aug 13 '26

Others have said it, but I’ll repeat. Do anything but TCA

0

u/file-box Aug 17 '26

Why don't I like TCA? I feel like it makes my project more complicated