I have a custom view ( NotifyView ) added to UIWindow with a dismiss button (which removes it from UIWindow ). This view is added when the PUSH notification comes in didReceiveRemoteNotification there are several cases where I could be on any screen, and my keyboard is UP via UITextfield / UITextview . At this point, if a click occurs, NotifyView added to the UIWindow behind the keyboard. I want to cancel the keyboard after receiving PUSH so that I can:
publish the notification using NSNotificaitonCenter to cancel all text fields / text fields (if there is firstResponder ). To do this, I have to keep an active pointer to the current active text field / text in all controllers.
make a variable in AppDelegate and assign active text fields / text fields to it, as well as PUSH and resignFirstResponder those located on PUSH.
Both solutions will require changes to all controller codes, and I'm looking for something more general, for example:
- there may be some way through which I could just remove the Keyboard from the screen when receiving PUSH
- or I could get the current firstResponder of the application and explicitly abandon it.
these may be general solutions.
It would be very helpful if someone could facilitate this process of thought, or someone has an immediate solution for this case.
samfisher
source share