How does UIView convert points between views?

Does anyone know the algorithm used by UIView's convertPoint:toView: and convertPoint:fromView: methods? In particular, do you know if they first convert the point to window coordinates and then to the target view's coordinate system, or might they take a short cut since the "from" view is an ancestor of the "to" view?

I ask because I have a loop which tests a point against a possibly large number of views and I'm wondering if it would be more efficient to convert that point to window coordinates once before the loop (which also has the advantage of not having to pass the point's view along into the loop and whatever it calls, knowing I can pass nil for the "fromView" argument) or to keep the point relative to the parent view.

The difference may be minor but, since it makes little difference to my code, I'd rather work with the system than against it.

12
задан big_m 16 May 2011 в 22:56
поделиться