title: UIApplication.sharedApplication not available
body: <p>I'm trying to get a reference to my app delegate from a UIViewController but I keep getting an this error message:</p>
  
  <blockquote>
    <p>'sharedApplication()' is unavailable: Use view controller based solutions where appropriate instead.</p>
  </blockquote>
  
  <p>I've been reading all the articles dealing with this kind of message but my problem seems unrelated as I'm not using any third party framework. While a Today Extension is part of my app, the class in which the error occurs is totally unrelated. I even created a completely new class and keep getting the same error:</p>
  
  <p><a href="https://i.stack.imgur.com/mp2qs.png"><img src="https://i.stack.imgur.com/mp2qs.png" alt="http://i.stack.imgur.com/mp2qs.png"></a>
  When I do the same thing in a playground it works fine. What am I missing?</p>