uiview - how to detect interface changes on iOS application -


is there possible way detect every change on user interface during runtime??

i'm trying find objects in current app interface.

i'm trying to nodes inspecting recursively main window, but, example, how know if top viewcontroller changes or if it's added uiview dynamically, or presented modalview??

the main objective have library this..

any idea, help?

thanks!

you write own library based on this, using advanced objective-c techniques. not recommend this, since breaks mvc patterns on ios. depends on want use for, maybe analytics?

so these options believe, if want actively inspect uiview hierarchy. options pretty complicated though.

  • swizzle methods such addsubview , removefromsuperview of uiview, know when changes happens. including getters of frame , bounds, if wish know position.

  • you use kvo watch properties such as: subviews, frame, bounds, superview notice changes. @ 1 point have add same object observer (could singleton).

  • decide interval fired a nstimer , go through hierarchy recursively beginning @ keywindow on uiapplication. have big performance impact though.

there may other options, these ones believe best choices.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -