title: How to fire an onApper method when a sheet close?
body: <p>I'm currently developing an application using SwiftUI.</p>
  <p>I want to use an <code>onAppear</code> method when a <code>sheet</code> created from the same struct close.</p>
  <p>Is there any way to do this?</p>
  <hr />
  <p>Here are the codes:</p>
  <p>BaseView.swift</p>
  <pre><code>import SwiftUI
  
  struct BaseView: View {
      
      @State var isSheet:Bool = false
      
      var body: some View {
          VStack{
              VStack{
                  Text(&quot;BaseView&quot;)
  
                  Button(action:{
                      isSheet = true
                  }){
                      Text(&quot;SHEET&quot;)
                  }
              }
              .onAppear(){
                  print(&quot;onAppear fiered&quot;)
              }
              .sheet(isPresented: $isSheet){
                  Sheet()
              }
          }
      }
  }
  </code></pre>
  <p>Sheet.swift</p>
  <pre><code>import SwiftUI
  
  struct Sheet: View {
      
      @Environment(\.presentationMode) var presentationMode
      
      var body: some View {
  
          Button(action: {
              self.presentationMode.wrappedValue.dismiss()
          }) {
              Text(&quot;CLOSE&quot;)
          }
      }
  }
  </code></pre>
  <hr />
  <p>Xcode:Version 12.0.1</p>