I am working on some framework, there I supply some view to the user of the framework.
I need to determine, each given moment where is located this view, that is subclass of UIView.
I can determine changes of it's superview, using KVO and subscribing for example to @"layer.position" changes. The problem is, that not only it's superview's position/frame can be changed, but also it's superview's superview and so on.
There are two obvious solutions, but both are not something:
- iterate on recursively on superviews and subscribe to @"layer.position" changes to each superview in the hierarchy, but it is very risky
- set timer and use polling, each time checking the actual location
I was wondering if there is something that is being called on UIView each time it is being physically (not only when is added as subview) redrew.