Replies: 1 comment 1 reply
-
I feel like TCA should offer the solution #3 as part of the standard library -- though it may be premature, as SwiftUI navigation may be subject to change. The complexity associated with having to manage multiple didAppear and didDisappear for optional state management is probably the biggest problem I've encountered with TCA ergonomics. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I’m using SwiftUI & ComposableArchitecture for a while already. I found it really nice, and I love the testability. However, with every project, there is one common issue that I’m experiencing - how to design & implement navigation properly.
I want to share my experience in this field. Even with a very simple navigation flow, there are things we need to be aware of and issues we need to address. I focused on two of them and described solutions I use in my apps:
NavigationLink
‘sisActive
binding with optional state and usingIfLetStore
for a destination. There are couple of ways we can address the problem. Although it’s easy to overcomplicate the implementation when doing so.I wanted to describe how I address the above problems here, but I ended in creating quite a long text. Instead, I will link it here (it’s available on GitHub): darrarski/Thoughts-on-SwiftUI-navigation.
I would love to hear what do you think about the ways I deal with navigation issues. Perhaps there are simpler solutions that I just missed. If you ever experienced other problems when implementing navigation with SwiftUI & ComposableArchitecture - please let me know in this discussion. I hope my experiences will be helpful for you, and I’m looking forward to see your comments.
P.S.: There is also a demo project I made to showcase the issues and solutions: darrarski/tca-swiftui-navigation-demo.
Beta Was this translation helpful? Give feedback.
All reactions