title: Modal pop up in swift 4
body: <p>I have been searching the internet lately for an implementation of the modal dialog box for iOS programming.</p>
  
  <p>I am aware of the UIAlertViewController. In fact, I am currently using this implementation in an application. But, I need something that is modal. I need the code to stop execution until the user clicks on the a button within the Alert.</p>
  
  <p>So far, I haven't really seen any implementations that I am happy with. THis is the current state of my code:</p>
  
  <pre><code>func messageBox(messageTitle: String, messageAlert: String, messageBoxStyle: UIAlertControllerStyle, alertActionStyle: UIAlertActionStyle)
      {
          var okClicked = false
          let alert = UIAlertController(title: messageTitle, message: messageAlert, preferredStyle: messageBoxStyle)
  
          let okAction = UIAlertAction(title: "Ok", style: alertActionStyle)
          {
              (alert: UIAlertAction!) -&gt; Void in
              okClicked = true
          }
  
  
      /*    alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: "Default action"), style: alertActionStyle, handler: { _ in
              okClicked = true
              NSLog("The \"OK\" alert occured.")
          }))*/
  
          alert.addAction(okAction)
  
          self.present(alert, animated: true, completion: nil)
          while(!okClicked)
          {
  
          }
      }
  </code></pre>
  
  <p>Should I look into creating my own dialog box hardcore style in the storyboard or does swift have some sort of implementation that I can sorta use?</p>