Is there a way to get a callback on custom lifecycle events exposed from the app?

I'm trying to capture snapshots as a visual validation of the state of a view in my UI tests. The work that I want to capture is after an async view is loaded (currently an embedded MapKit view). I'm wondering if there's a way that I can expose a marker when the Map has completed its loading and rendering to UIApplication() through the usability system, even if it's something I intentionally expose up from the app with my own code that isn't done by default.

Right now I'm waiting on a Link to show up with:

UIApplication().links["Legal"].waitForExistence(timeout: 2)

as Map is currently exposing a link to legal from within itself after the rendering is set up, but that's a detailed side effect of MapKit specifically. For other views that my code loads asynchronously, can I do something to expose an event or callback book that I can react to within the UIApplication() structure to know that relevant background processing has completed, or is observing for UIElements to exist in some form the only exposed way of getting this kind of information?


Is there a way to get a callback on custom lifecycle events exposed from the app?
 
 
Q