title: Attempt to present UIAlertController on while a presentation is in progress
body: <p>I am doing request in background thread, After getting response I am trying to show <code>UIAlertController</code> on main thread. But some time it is not showing <code>UIAlertController</code>.</p>
  
  <p>Here is my code</p>
  
  <pre><code>func showAlertMessage() -&gt; Void {
  
      DispatchQueue.main.async {
  
          let alertController = UIAlertController(title: kSuccess, message: kSuccessfullyLoggedOut, preferredStyle: .alert)
  
          let cancelAction = UIAlertAction(title: "OK", style: .cancel) { (action :UIAlertAction) in
  
              DispatchQueue.main.async {
                  self.dismiss(animated: true, completion: nil)
              }
          }
  
          alertController.addAction(cancelAction)
  
          self.present(alertController, animated: true, completion: nil)
      }
  }
  </code></pre>