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.
UIApplication.sharedApplication().addObserver(self, forKeyPath: "windows", options: NSKeyValueObservingOptions.allZeros, context: &myContext)