title: How can I perform a segue after receive an alert answer
body: <p>Today I'd like to try to make a part of an application that after show an alert perform a segue ONLY if the user press on the "Yes" alert's button. 
  To explain me better I'd like that the application will show an aller that say "Are you sure to return to Home?" and it will have two Botton: "Yes" and "No". If the user press no nothing happen, if the user press yes the application perform a segue. The problem is that I don't know how to do it. </p>
  
  <p>I try to write some code line but it doesn't work.</p>
  
  <pre><code>func Alert (TITLE: String, MESSAGE: String) -&gt; Bool()
      {
          var X = false
          let Alert = UIAlertController(title: TITLE, message: MESSAGE, preferredStyle: UIAlertControllerStyle.alert)
          Alert.addAction(UIAlertAction(title: "Yes", style: UIAlertActionStyle.default, handler: { (Action) in
          X = true
          Alert.dismiss(animated: true, completion: nil)
          }))
  
          self.present(Alert, animated: true, completion: nil)
  
          Alert.addAction(UIAlertAction(title: "No", style: UIAlertActionStyle.default, handler: nil))
          self.present(Alert, animated: true, completion: nil)
      return X
      }
  
  
  
  @IBAction func ButtonAct(_ sender: Any)      //This happen if you click the botton on the screen of the iPhone
  {
  if Alert (TITLE: "Return to Home", MESSAGE: "Are you sure to return Home?")
  {performSegue(withIdentifier: "Segue", sender: self)}
  }
  </code></pre>
  
  <p>Thank you for you Help </p>