Replies: 1 comment
-
@mbrandonw @stephencelis If you have a moment, could you point me to a real‑world example or share any guidance on best practices for large‑scale navigation? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone, and thanks in advance for your help.
Also, I am already familiar with patterns such as MVVM‑C, Routers, and Coordinators, so I do not need conceptual explanations of those ideas.
• Project context
– iOS 17 minimum target
– Xcode 16.3, Swift 6.0
– TCA 1.19.1 (I have also read through parts of the TCA and swift‑navigation source code)
Despite that, I’m struggling to keep my navigation code manageable.
The current approaches feel either too verbose or too tightly coupled, and turning the logic into something modular for a future micro‑feature (micro‑service) architecture looks painful.
After weeks of experimentation my options seem to boil down to two patterns:
1️⃣ Delegate from child → handle in parent
Each child feature emits a delegate action, the parent inspects it and pushes / pops on
StackState
.2️⃣
@Shared(.path)
Treat the shared
StackState
almost like a@Binding
, allowing child features to push / pop directly.I’m currently using pattern ①, but the boilerplate of writing delegate actions and parent‑side switch statements for every simple navigation is becoming a burden.
Pattern ② is much more pleasant, yet I worry it will block me later when I break the project into independent modules (micro‑feature architecture).
Could you point me to a real‑world example or best‑practice repo that scales to a large codebase while keeping navigation maintainable?
Any guidance or experience reports would be greatly appreciated.
Honestly, I don’t consider my app to be that large, yet the navigation code is already becoming hard to read and reason about.
Any help or pointers would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions