title: SwiftUI How to Navigate to Multiple Possible Views Depending on Conditional?
body: <p>Creating a Study App, if I click on the tabs Cue Card, Multiple Choice Test, or Practice Test I want to navigate to three different views possibly but I want to do that all from one Tab View where I have a navigationLink that is a variable or something that depends on whether I clicked the tab Cue Card, Multiple Choice Test, or Practice Test.</p>
  <p>I also already tried doing this in the enum method from the video <a href="https://www.youtube.com/watch?v=sGiFR0IZCz4&amp;t=53s" rel="nofollow noreferrer">https://www.youtube.com/watch?v=sGiFR0IZCz4&amp;t=53s</a> but could not figure it out.</p>
  <p><a href="https://i.stack.imgur.com/EcNbI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EcNbI.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/HUKFk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HUKFk.png" alt="enter image description here" /></a></p>
  <pre><code>import SwiftUI
  
  struct SelectionView: View {
      
  var body: some View {
      NavigationView{
          VStack {
              TabsView(selection: &quot;Cue Cards&quot;)
              TabsView(selection: &quot;Multiple Choice&quot;)
              TabsView(selection: &quot;Practice Test&quot;)
              
  
          }.navigationBarBackButtonHidden(true)
          
      }
      
      
  }
  
  
  
  
  
  struct SelectionView_Previews: PreviewProvider {
      static var previews: some View {
          Group {
              SelectionView().previewDevice(&quot;iPhone 8&quot;)
              SelectionView().previewDevice(&quot;iPhone 11 Pro&quot;)
              SelectionView().previewDevice(&quot;iPhone 11 Pro Max&quot;)
              
          }
      }
     }
  }
  import SwiftUI
  
  
  struct TabsView: View {
  
  @State private var isActive = false
   var selection = &quot;&quot;
  
  var body: some View {
  
      VStack{
          //WANT CUECARDCATEGORYVIEW() TO BE A VARIABLE OR SOMETHING THAT CAN 
   LEAD TO CUE CARD VIEW, MULTIPLE CHOICE TEST VIEW, OR PRACTICE TEST VIEW.
          NavigationLink(destination: CueCardCategoryView(), isActive: 
  $isActive)
          {
              Button(action: {isActive = true }) {
                  HStack{
                      Text(&quot;\(selection)&quot;)
                          .font(.system(size: 28, weight: .semibold))
                          .multilineTextAlignment(.center)
                      Spacer()
                  }
              }
          }.buttonStyle(PrimaryButtonStyle(fillColor: .primaryButton))
          
      }.padding(15)
  }
  
  }
  
  struct TabsView_Previews: PreviewProvider {
  static var previews: some View {
      NavigationView{
          TabsView()
      }.environment(\.colorScheme, .dark)
      .environment(\.colorScheme, .light)
      
    }
  }
  </code></pre>