The Composable Architecture II
Navigation in TCA
The Composable Architecture II
Navigation in TCA
0
0
Checkbox to mark video as read
Mark as read

Navigation in SwiftUI can be challenging, especially when building complex apps with dynamic requirements. The TCA (The Composable Architecture) framework simplifies state management and enables organized navigation patterns like tree-based and stack-based navigation while handling dismissals efficiently.

In this article we are going to see how to create the same navigation in both patterns, tree-based and stack-based, how to test it, and finally how to dismiss programmatically.

You can find the Example project on GitHub, where each navigation pattern has been placed in a different target.

Each of this navigation patterns will contain the same screens:

  • MainMenu: The main view that shows two buttons, one to go to the SignIn screen and another one to go to the SignUp screen.
  • SignIn: Nothing special, just a sample screen.
  • SignUp: Here we'll find a button that will simulate the end of the sign up, opening SignUpConfirmation screen.
  • SignUpConfirmation: Nothing special, just a sample screen.


Tree-Based Navigation

In this navigation pattern, each view presents the next. The advantage is avoiding all the code in one place, but the drawback is losing centralized flow control.

Continue reading

Access to all the content with our plans.

Basic Plan

FREE

Start Now
  • Junior level content
  • Senior level content
  • Expert level content
  • Extra content
  • Question submissions
Monthly
Yearly

Plan logo

-

Unlimited access to the whole content

  • Junior level content
  • Senior level content
  • Expert level content
  • Extra content
  • Question submissions

Stripe secure payment methods
Plan logo

-

Unlimited access to the whole content

  • Junior level content
  • Senior level content
  • Expert level content
  • Extra content
  • Question submissions

Stripe secure payment methods
Plan logo

-

Solve your doubts at any level

  • Junior level content
  • Senior level content
  • Expert level content
  • Extra content
  • 2 Question submissions per week

Stripe secure payment methods
Plan logo

-

Solve your doubts at any level

  • Junior level content
  • Senior level content
  • Expert level content
  • Extra content
  • 2 Question submissions per week

Stripe secure payment methods

0 Comments

Join the community to comment

Be the first to comment

Accept Cookies

We use cookies to collect and analyze information on site performance and usage, in order to provide you with better service.

Check our Privacy Policy