title: Trigger an event after programmatically making a phone call
body: <p>I have an iOS application that programmatically lets the user make a phone call. </p>
  
  <p>I would like to display a popup asking a question when the user's phone call has finished (and the user is automatically taken back to the app they made the phone call from).</p>
  
  <p>What is a recommended way to do this in swift?</p>
  
  <hr>
  
  <p>Here is the current code:</p>
  
  <pre><code>    @IBAction func makePhoneCall(_ sender: UIButton) {
          let phone = getPhone().filter(characterOkay)
          if let url = URL(string: "tel://\(phone)"), UIApplication.shared.canOpenURL(url) {
              if #available(iOS 10, *) {
                  UIApplication.shared.open(url)
              } else {
                  UIApplication.shared.openURL(url)
              }
          }
  
          // This incorrectly shows the popup before the phone call. 
          showQuestionPrompt();
      }
  </code></pre>