title: How to get subview's frame in the windows' reference (objc)?
body: <p>I've already found some kind of solution to the question I answered but it doesn't fix the problem I have:</p>
  <p>(where I searched : <a href="https://stackoverflow.com/questions/17572304/get-position-of-uiview-in-respect-to-its-superviews-superview">Get position of UIView in respect to its superview&#39;s superview</a>,</p>
  <p><a href="https://stackoverflow.com/questions/8082493/how-to-get-the-frame-of-a-view-inside-another-view">How to get the frame of a view inside another view?</a>,</p>
  <p><a href="https://stackoverflow.com/questions/7028850/ios-get-location-of-a-view-in-a-window">iOS - Get location of a view in a window?</a> ...and more)</p>
  <p>I wrote that code:</p>
  <pre><code>CGRect targetFrame = [self.view convertRect:self.buttonImageView.frame
                                             fromView:self.view];
  CGRect superView1Frame = [self.view convertRect:self.buttonImageView.superview.frame
                                             fromView:self.view];
  CGRect superView2Frame = [self.view convertRect:self.buttonImageView.superview.superview.frame
                                             fromView:self.view];
          
  targetFrame.origin.y = targetFrame.origin.y + superView1Frame.origin.y + superView2Frame.origin.y;
  targetFrame.origin.x = targetFrame.origin.x + superView1Frame.origin.x + superView2Frame.origin.x;
  </code></pre>
  <p>which works well and I can get the target frame I want.</p>
  <p>But, the fact is that code is very ugly and I'm sure there is another way to do it. I've already tried that kind of things :</p>
  <pre><code>CGRect targetFrame = [self.wallButtonImage.superview.superview convertRect:self.wallButtonImage.frame
                                                                            fromView:self.buttonImageView.superview.superview];
  return [self.wallButtonImage.superview.superview convertRect:targetFrame
                                                              fromView:self.buttonImageView.superview.superview];
  </code></pre>
  <p>But it doesn't work at all...</p>
  <p>Question(s) : Is there a way to get the same result as I did have in my first example but using another method? Or is there simply better way to do it?</p>
  <p>Also, I can't understand why I can't find any other solution for it, so can you please explain me what you would have done?</p>