title: Displaying data from one view in another view
body: <p>I have a view, that currently displays a list of Recipes. I have a button for each corresponding recipe in the list, my goal is when a user selects a recipe, they are directed to another view that displays the information from the selected item.</p>
  <p><strong>RecipeList</strong></p>
  <pre><code>struct RecipeListView: View {
      var listofRecipes: [RecipeListModel] = RecipeList.recipes
    
      init(){
          UITableView.appearance().backgroundColor = .clear
      }
      var body: some View {
          NavigationView{
          VStack{
              Text(&quot;Recipes&quot;)
                  .padding(.top, 40)
                  .font(.title2)
              List(listofRecipes, id: \.id){ recipe in
                  HStack{
                      Image(recipe.image)
                          .resizable()
                         .frame (width: 70, height:70)
                          .cornerRadius(15)
                          
                      VStack{
                          Text(recipe.name)
                              .font(.title3)
                          
                          Button(action: {
                             //action
                          }){
                              Text(&quot;View Recipe&quot;)
                                  .font(.body)
                                  .foregroundColor(.white)
                                  .frame(width:120, height:30)
                                  .background(Color(&quot;completeGreen&quot;))
                          }
                      } .padding(.leading, 40)
                  }
              }
              
          }
      }
      }
  }
  </code></pre>
  <p><strong>Recipe View - Recipe clicked from previous view will display here</strong></p>
  <pre><code>struct RecipeController: View {
      @State var recipeEdit = true
  
      var recipeList = RecipeList.recipes
      var body: some View {
          NavigationView{
          VStack{
              Text(&quot;will display recipe.name of clicked value in recipe list view&quot;) 
              RecipeEntryPicture()
              RecipeIngredients(isEditing: $recipeEdit)
          }
          .toolbar{
              ToolbarItem(placement: .bottomBar){
                      Button(action: {
                          recipeEdit.toggle()
                      }){
                          HStack{
                          Image(systemName: &quot;pencil.circle&quot;).foregroundColor(.black)
                              Text(recipeEdit ? &quot;Edit&quot; : &quot;Complete&quot;)
                              .foregroundColor(.black)
                          }
                          .font(.title)
                      }
                      .edgesIgnoringSafeArea(.all)
                      .frame(maxWidth: .infinity)
                      .frame(height: 60)
                      .background(Color(recipeEdit ? &quot;spaceGray&quot; : &quot;completeGreen&quot;))
                      
                  }
              }
          }
        }
      }
  </code></pre>