title: CGRectIntersectsRect: how change the detection to the edge of the picture inside UIImageView
body: <p>Here is the code i'm using to detect if 2 <code>UIImageViews</code> hit each other.</p>
  
  <pre><code> if (CGRectIntersectsRect(Appy.frame, Bottom.frame)) {
     [self GameOver];
  }
  </code></pre>
  
  <p>At the moment its detecting the edge of the object.</p>
  
  <p>How do i change it to detect the edge of the image inside the UIImageView.</p>
  
  <p>The image inside has a transparent background and is "practically circle" so they are colliding if the corner of UIImageView hits the corner of another UIImageView but the image is not actually hitting so its making things look a little "messy"</p>
  
  <p><strong>EDIT*</strong></p>
  
  <p><img src="https://i.stack.imgur.com/sIdCw.jpg" alt="Errors im getting"></p>
  
  <p>these are the errors im getting </p>
  
  <p><img src="https://i.stack.imgur.com/N4uxq.jpg" alt="enter image description here">
  this is my .h</p>
  
  <hr>
  
  <p>EDIT: below is what my code now looks like</p>
  
  <p><strong>.m Method</strong></p>
  
  <pre><code>if (CGRectIntersectsRect([self: RectBox:Appy].frame, Bottom.frame)) {
          [self GameOver];
      }
  </code></pre>
  
  <p><strong>.h</strong></p>
  
  <pre><code>-(UIImageView *)RectBox:(UIImageView *)box;
  </code></pre>
  
  <p>i put this just above the very last <code>@end</code> on my .h just to be sure.</p>
  
  <p>Im still "getting use of undeclared identifier 'RectBox'"</p>
  
  <p><strong>EDIT</strong></p>
  
  <p><img src="https://i.stack.imgur.com/3onxL.png" alt="Debug screem"></p>
  
  <p><strong>EDIT</strong></p>
  
  <p>As requested here is the code in which i call the method</p>
  
  <pre><code>-(void) PipeMoving2{
  
      PipeTop2.center = CGPointMake(PipeTop2.center.x -2, PipeTop2.center.y);
      PipeBottom2.center = CGPointMake(PipeBottom2.center.x -2, PipeBottom2.center.y);
  
  
  
  
  
      if (PipeTop2.center.x &lt; -53+33) {
          [self PlacePipe2];
      }
  
      if (PipeTop2.center.x == 62) {
          [self Score];
      }
  
  
      if (CGRectIntersectsRect(Appy.frame, PipeTop2.frame)) {
          [self GameOver];
      }
  
      if (CGRectIntersectsRect(Appy.frame, PipeBottom2.frame)) {
      [self GameOver];
      }
  
      if (CGRectIntersectsRect(Appy.frame, Top.frame)) {
          [self GameOver];
      }
  
      if (CGRectIntersectsRect([self RectBox:Appy].frame, Bottom.frame)) {
          [self GameOver];
      }
  
  }
  </code></pre>
  
  <p>i think this is all u need to see right?</p>