title: Attempting to move modally programatically through a UIAlert
body: <p>I am currently trying to go from one view to another modally via an alert pop-up when you press ok. </p>
  
  <p>The problem is the code I'm trying to use isn't moving from one screen to the other. I'm not sure why. </p>
  
  <p>The Code:</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController {
      @IBAction func helpButtonPushed(_ sender: UIButton) {
          let alertController = UIAlertController(title: "Help has been sent", message: "Please move towards the Student Services Area. ", preferredStyle: .alert)
  
          self.present(alertController, animated: true, completion: nil)
  
          let okAction = UIAlertAction(title: "Ok", style: .default, handler: { (alertAction) in
              //Show the quiz. 
              let storyBoard : UIStoryboard = UIStoryboard(name: "QuizViewcontroller", bundle:nil)
  
              let nextViewController = storyBoard.instantiateViewController(withIdentifier: "Quiz") as! QuizViewController
              self.present(nextViewController, animated:true, completion:nil)
  
          })
  
          alertController.addAction(okAction)
      }
  }
  </code></pre>
  
  <p>The two viewControllers I'm trying to use: ViewController and QuizViewController. </p>
  
  <p><img src="https://i.stack.imgur.com/ZmCBy.png" alt="View Contollers"></p>
  
  <p>Thanks in advance</p>