title: SwiftUI - How to close the sheet view, while dismissing that view
body: <p>I want to achieve the function. Like, "Look up" view that is from Apple.</p>
  
  <p>My aim is when the sheet view push another view by navigation, the user can tap the navigation item button to close the sheet view. Like, this below gif.</p>
  
  <p><a href="https://i.stack.imgur.com/4c6Qn.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/4c6Qn.gif" alt="enter image description here"></a></p>
  
  <p>I try to achieve this function.</p>
  
  <p>I found a problem that is when the user tap the "Done" button. The App doesn't close the sheet view. It only pop the view to parent view. Like, this below gif.</p>
  
  <p><a href="https://i.stack.imgur.com/H0YhS.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/H0YhS.gif" alt="enter image description here"></a></p>
  
  <p>This is my code.</p>
  
  <pre class="lang-swift prettyprint-override"><code>import SwiftUI
  
  struct ContentView: View {
      @State var isShowSheet = false
      var body: some View {
          Button(action: {
              self.isShowSheet.toggle()
          }) {
              Text("Tap to show the sheet")
          }.sheet(isPresented: $isShowSheet) {
              NavView()
          }
      }
  }
  
  struct NavView: View {
      var body: some View {
          NavigationView {
              NavigationLink(destination: NavSubView()) {
                  Text("Enter Sub View")
              }
          } .navigationViewStyle(StackNavigationViewStyle())
      }
  }
  
  struct NavSubView: View {
      @Environment(\.presentationMode) var presentationMode
  
      var body: some View {
          Text("Hello")
          .navigationBarItems(trailing:
              Button(action: {
                  self.presentationMode.wrappedValue.dismiss()
              }){
                  Text("Done")
              }
          )
      }
  }
  
  </code></pre>
  
  <p>How did I achieve this function? :) 
  Please help me, thank you. :) </p>