title: Calling presentViewController from custom class
body: <p>I read <a href="https://stackoverflow.com/questions/29323449/how-to-call-presentviewcontroller-from-inside-class">this post</a> and <a href="https://stackoverflow.com/questions/27735050/show-alertcontroller-from-a-custom-class">this one</a> on how to call a presentViewController form outside a UIViewController subclass. In my case, the custom class is a subclass of NSObject. The following approach is the only one that works (from the examples I read):</p>
  
  <pre><code>UIApplication.sharedApplication().keyWindow?.rootViewController?.presentViewController(alertController, animated: true, completion: nil)
  </code></pre>
  
  <p>My question: is there a better solution that does not rely on the appDelegate (as I understood this approach is design-wise not very neat)...</p>