4

We're developing an SDK for external usage. One of the requirements is that we build a history detailing how the user progresses through the application, ie., what view controllers are displayed. Since this is being provided as an SDK, we really need the tracking to be as unobtrusive as possible, and preferably require as little developer interaction as possible.

The biggest issue that I'm running into right now is how to keep track of when view controllers (and possibly view controller stacks or hierarchies) are displayed modally. I've tried using KVO to observe the presentedViewController property of the parent UIViewController, but it doesn't seem to be updated for modally presented view controllers.

I can determine the current view controller by building the tree starting at the window, but I need to actually execute code whenever the visible view controller changes.

Any thoughts? Some NSNotificationCenter message I'm missing?

David Berry
  • 40,941
  • 12
  • 84
  • 95
  • Note, http://stackoverflow.com/questions/30040733/notification-when-view-controller-is-presented-modally-dismissed isn't a duplicate because the answer requires the developer taking a positive action to notify me that the VC has changed. – David Berry Jan 20 '16 at 17:12

0 Answers0