Question

I would like to know if there is anyway I could get a callback everytime the displayed view changes and receive the newly displayed view as a parameter of the callback?

Can this be achieved with the key-value observing protocol?

Here is more details: I develop an SDK so I don't know what the client app is doing wrt controllers but I would like to know every time a new view controller is presented by the client app. Or in other terms, I would like to know when the displayed view on the UIWindow changes.

Thanks a lot for your help.

Était-ce utile?

La solution

Here is the recipe that solves my problem: http://broutille.wordpress.com/2011/06/09/ios-how-to-monitor-the-change-of-viewcontrollers-inside-a-uinavigationcontroller/.

That and adding an observer for the "UIWindowDidBecomeKeyNotification" notification.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top