title: How to dismiss SFSafariViewController on UIView
body: <pre><code>class CustomScreen: UIView, SFSafariViewControllerDelegate {
  @IBAction func webPageBtnAction(_ sender: Any) {
      if #available(iOS 9.0, *) {
          let svc = SFSafariViewController(url: NSURL(string: "https://stackoverflow.com/")! as URL)
          svc.delegate = self
          let appDelegate = UIApplication.shared.delegate as! AppDelegate
          appDelegate.window?.rootViewController = svc
      } else {
          // Fallback on earlier versions
      }
  }
  
  @available(iOS 9.0, *)
  func safariViewControllerDidFinish(_ controller: SFSafariViewController) {
      controller.dismiss(animated: false, completion: nil)
  }
  }
  </code></pre>
  
  <p>In some reason i am not able to dismiss the SFSafariViewController. Any idea?</p>