iOS Z-order of UIView
<p>How can I get the Z-order of a <code>UIView</code> in regards to the key window?</p>

<p>The heirarchy depth is not of interest to me. I don't care about how many superviews to the key window.</p>

<p>Just want to know which views appear "closer" to the user.</p>

<p>I've tried various possibilities such as </p>

<pre><code>hittesting
view.layer.depth
post-order DFS (Or some sort of variation)
</code></pre>

<p>but this resulting answer is in regards to its "surroundings" and not the actual "painting order" of the view on the screen.</p>

<p>Is this possible in a reasonable fashion?</p>