This tutorial is provided by pointfreeco, the creators of the TCA library, and it’s great for getting started with TCA. I organized my findings while exploring how to use it.
TCA is a library that helps implement architecture, so I added it to my project. After installing the library, I noticed a significant increase in build time. Upon researching, it seems that Apple mentioned an increase in Swift Syntax compilation time, which can lead to longer build durations.
When using TCA with SwiftUI, the Store is connected to the View, and it receives Actions to modify the State.
The object that changes the State upon receiving Actions is managed by a Feature that conforms to the Reducer protocol.
From my experience learning TCA, I initially thought it might end up heavy like the Controller in MVC or ViewModel in MVVM because it primarily separates View and Feature. However, I found it natural to break down Features into smaller parts and integrate them. Swift Macros are well-implemented, which contributes to the overall neatness of the structure.
Additionally, while conducting Unit tests, it was easy to test just the Features, and tools like TestStore make writing test code very convenient.
I wanted to split my personal Design System into multiple Targets and host it in a private Spec repository, so I added a SwiftUI Target.
I wrote a shell script to find and update the versions in the podspec files when raising the library’s version. After the script runs, a workflow triggers to also update the tag version. However, I encountered issues on Linux, so for now, I temporarily configured the shell script to update the tag version directly.
There was an issue where the conditional compilation didn’t correctly branch for the Build Configuration in the preprocessor directives.
OTHER_SWIFT_FLAGS[config=Release]=$(inherited) -D RELEASE
.While applying Tuist, there was an issue where after Fastlane deployment, the version update was only applied to the Xcode project, leading to version mismatches.
There was also an issue where Fastlane couldn’t retrieve the build number.
$ agvtool what-version
fails to retrieve the version, change the Versioning System in Build Settings to AppleGeneric.