

-
Update 10.04.2021: Thanks to the feedback I received from Thomas Visser I managed to refactor the above NavigationLink code. It's now a bit simpler and does not require storing the last non-nil value in a @State property. You can check out how does it look now in the example project's repository.
-
CodeRabbit
CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
-
swift-composable-architecture
A library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind.
Another solution comes from the authors of ComposableArchitecture, although it's not (yet) an official one. On a separate branch, there is an extension to the Reducer that is meant to be used to solve our problem. Instead of combining reducers with .optional and .pullback operators as proposed earlier, we can use .presents operator, like this:
Related posts
-
Looking for SwiftUI templates/architectures
-
Did you know: It is possible to write declarative and immutable Swift that resembles natural English, just with some very wild punctation.
-
Kaleidoscope of iOS app architectures
-
My largest project yet: A fully themable, powerful task manager and daily planner built with SwiftUI. Available on iPhone and iPad for free (no ads, IAP or data collected).
-
Laugh at my horrible App structure and help me do it right