title: How do I get a popup dialog box in Swift Playgrounds
body: <p>I was wondering how to get a dialog box to popup in Swift <strong>Playgrounds</strong> (yes must be in Playgrounds) I've tried the following code (directly from the AppleDevs site)</p>
  
  <p>However, no matter what I try, the <code>self</code> tag <strong>always</strong> throws an error. Can anyone help me with this?</p>
  
  <pre><code>import UIKit
  let alert = UIAlertController(title: "My Alert", message: "This is an alert.", preferredStyle: .alert) 
  alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: "Default action"), style: .default, handler: { _ in 
      NSLog("The \"OK\" alert occured.")
  }))
  self.present(alert, animated: true, completion: nil)
  </code></pre>