title: Is there a better way to use handler in UIAlertController (Swift)?
body: <p>I'm trying to use an AlertController to allow the user to return to the main menu, if a certain calculated value is exceeded. I know that using a simple segue will lead to memory problems.  Is there a way to use the popToRootViewController method in this situation instead of simply using a segue? The compiler yells at me (no doubt for good reasons), but gives me no useful suggestions. I know the problem stems from the handler for the Abort Fit action.  Can someone point me in the right direction?  </p>
  
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
  
      if deltaK &gt; 2.25 {
  
      var helpAlert = UIAlertController(title: "Stop!", message: "Due  to high toricity, the fit should be aborted.", preferredStyle: .Alert)
  
       helpAlert.addAction(UIAlertAction(title: "Abort Fit", style: UIAlertActionStyle.Default, handler: { action in self.navigationController.popToRootViewControllerAnimated(true)) })
  
       helpAlert.addAction(UIAlertAction(title: "Continue", style: UIAlertActionStyle.Default, handler: nil))
          self.presentViewController(helpAlert, animated: true, completion: nil)
      }
  </code></pre>