UIView convertRect: - finding subview position two views deep
<p>In the pictures below, each rectangle is a UIView. View A has a weak reference to view C. View A creates view D and needs to add it as a subview to view C so that view A is covered completely. I therefore need to get the position of view A relative to view C. Adding view D as a subView of view A at {0,0} is not an option for this particular case - it has to be a subview of C.</p>

<p><em>View hierarchy starting point</em>
<a href="https://i.stack.imgur.com/rXnID.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rXnID.png" alt="View hierarchy starting point"></a></p>

<p><em>View hierarchy goal point</em>
<a href="https://i.stack.imgur.com/PhOuf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PhOuf.png" alt="View hierarchy goal point"></a></p>

<p>I've tried every combination of <code>convertRect:toView:</code> and <code>convertRect:fromView:</code> I can think of, passing in combinations of the three views as sender and receiver as well as using their subviews, but there are too many combinations and I just can't understand how it works. I would be really grateful if somebody could post the correct syntax firstly so I can get it working and more importantly so I can work through a working example to understand what the function is actually doing.</p>

<p>Many thanks in advance!</p>