-
Hi @pointfree |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Watch the series to the end and you'll have most of your answers. Much of the structure they build in order to get good testability, handle dependencies, and make some types of observation work, are all things handled for you by TCA. Plus the additional structure TCA requires removes much of the design uncertainty around typical SwiftUI observables and data models. And of course the testing tools are all built in. |
Beta Was this translation helpful? Give feedback.
-
Hi @bitsarat, we don't consider one "better" than the other. They are different styles for different use cases. That is why we maintain TCA, swiftui-navigation, swift-dependencies, etc. Building apps in the style we demonstrated in the "Modern SwiftUI" series can be very powerful, and can get you very far. But there are some downsides that TCA tries to address. Since TCA is largely built on value types there are tools that we can offer that are impossible for vanilla SwiftUI. For example, you can add And that debug tool dovetails with testing too. TCA can provide a very simple testing tool that allows you to exhaustively prove how everything works in your feature, including dependencies and effects. That tool is also not possible in vanilla SwiftUI. And dovetailing with the debug and testing tools, TCA is a single entry point system that allows you to do a lot of powerful things, such as override dependencies for one specific part of an application. That is also something that is not really possible in vanilla SwiftUI, but quite easy in TCA. We take advantage of that in our isowords application in order to show an onboarding experience with all dependencies mocked to return very specific data that way we can control exactly what the user experiences. And this is just a small sample of the things TCA has to offer. Again, we aren't saying one is absolutely better than the other, just that each have their pros and cons. And we will continue pushing each style to their limits. |
Beta Was this translation helpful? Give feedback.
Watch the series to the end and you'll have most of your answers. Much of the structure they build in order to get good testability, handle dependencies, and make some types of observation work, are all things handled for you by TCA. Plus the additional structure TCA requires removes much of the design uncertainty around typical SwiftUI observables and data models. And of course the testing tools are all built in.