title: hitTest on CALayer - how do you find which actual layer was hit?
body: <p>Situation: need to find which layer the user has touched.</p>
  
  <p>Problem: Apple says we should use [CALayer presentationLayer] to do hit-testing, so that it represents what is actually on screen at the time (it captures info mid-animation etc).</p>
  
  <p>...except: presentationLayer does NOT return the original layers, it returns copies of them ... so: the hitTest will return a brand new CALayer instance that is not equivalent to the original.</p>
  
  <p>How do we find which actual CALayer was hit?</p>
  
  <p>e.g.</p>
  
  <pre><code>CALayer* x = [CALayer layer];
  CALayer* y = [CALayer layer];
  [self.view.layer addSublayer: x];
  [self.view.layer addSublayer: y];
  
  ...
  
  CALayer* touchedLayer = [self.view.layer.presentationLayer hitTest:touchPoint];
  </code></pre>
  
  <p>...but, is touchedLayer "x", or is it "y"?</p>
  
  <pre><code>if( touchedLayer == x ) // this won't work, because touchedLayer is - by definition from Apple - a new object
  </code></pre>