title: How can I get the frame of a table view cell in the coordinate space of the table view?
body: <p>I have a table view with a bunch of cells in it. I want to get the frame of a cell, not in its superview's coordinate space, but in the table view's coordinate space.</p>
  
  <p>A picture would probably explain this better</p>
  
  <p><a href="https://i.stack.imgur.com/FPQEom.png" rel="noreferrer"><img src="https://i.stack.imgur.com/FPQEom.png" alt="enter image description here"></a></p>
  
  <p>See the red rectangle? That is the frame of the table cell. And the blue rectangle is the frame of the table view. I want to get the red rectangle that is relative to the blue rectangle.</p>
  
  <p>I tried to use the <code>frame</code> property of <code>UITableViewCell</code>. But that doesn't work because it returns (0, 0, 320, 44). The Y value shouldn't be zero because obviously the cell is not at the top of the screen.</p>
  
  <p>According to the view hierarchy, this is the intended behaviour, because the superview of a table cell is apparently this <code>UITableViewWrapperView</code>, not the table view:</p>
  
  <p><a href="https://i.stack.imgur.com/biOOY.png" rel="noreferrer"><img src="https://i.stack.imgur.com/biOOY.png" alt="enter image description here"></a></p>
  
  <p>while the table view is this:</p>
  
  <p><a href="https://i.stack.imgur.com/7feC0.png" rel="noreferrer"><img src="https://i.stack.imgur.com/7feC0.png" alt="enter image description here"></a></p>
  
  <p>So is there a method/property that can get me a <code>CGRect</code> that represents the frame of the table view cell in the coordinate space of the table view?</p>
  
  <p>I think there is a function that can convert a <code>CGRect</code> in a coordinate space to another. But I forgot its name and how to use it. I don't know whether it is helpful in this situation.</p>