title: How to call a function after closing a popover?
body: <p>I hope someone can give a beginner some guidance, my problem is this:</p>
  
  <p>I have a popover window
  I open that popover with a segue from the mainViewController
  I want to trigger a function in the mainViewController when the popover is closed
  Inside the popover I have a button to close the popover with the following code:</p>
  
  <pre><code>@IBAction func closeButton(_ sender: Any) {
  
          dismiss(animated: true, completion: {checkIfPopoverDismissed()}) // I want to trigger this function in the mainView
      }
  </code></pre>
  
  <p>In the mainViewController I have the following function, that I want to be triggered by the closure of the above popover</p>
  
  <pre><code> func checkIfPopoverDismissed()
      {
        print("the function is triggered")
      }
  </code></pre>
  
  <p>So with the above I get:</p>
  
  <pre><code> Use of unresolved identifier 'checkIfPopoverDismissed'
  </code></pre>
  
  <p>Because obviously checkIfPopoverDismissed() is in the mainViewController and does not exist in the popover view.</p>
  
  <p>Any idea how I can make this work simply?</p>