0

In iOS, is there a listening function that will enable an app detect when there is a banner (from any other application like whatsapp/snapchat/iMessage banners) on the screen/UI? For example, to detect brightness change I have something like this:

NotificationCenter.default.addObserver(
            self,
            selector: #selector(self.levelChanged),
            name: .UIScreenBrightnessDidChange,
            object: nil)

I also found this post, which is similar but I want my app to just know (on a binary level) if there is a banner or not, I do not need to know the content or source app of the banner.

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
KingK
  • 1
  • 1
  • By "banner pop up" you mean a notification? As the linked post said - you can't know about notifications from other apps. – Losiowaty Nov 17 '17 at 14:37
  • What purpose you have. May be it can have a different solution – ahmed Nov 17 '17 at 19:23
  • I just need my code to react to banner notifications when they appear on the screen from other apps – KingK Nov 24 '17 at 10:23

0 Answers0