title: Detect when system alertView willAppear/willDismiss
body: <p>I want to detect when system alertView, like in-app purchase confirmation alert appears on screen.
  I'm trying to add key value observer to UIApplication, but it doesn't work.</p>
  
  <pre><code>UIApplication.sharedApplication().addObserver(self, forKeyPath: "windows", options: NSKeyValueObservingOptions.allZeros, context: &amp;myContext)
  </code></pre>