0

I have this image in PNG format link. I inserted this image in my application through a imageView.

All I'm trying to do is detect when another imageView slope that my candy cane image, for that, I used the code below:

CGRectIntersectsRect(self.bird.frame, TunelBot.frame)

But there is a small problem, my bird image was not even playing the Candy Cane image the CGRect already recognizes the touch, this is because the imageView have a rectangular shape, and the candy cane image has another shape.

Now, what I could to do, to detect when the image of the bird intersects in real shape of my candy cane image?

matt
  • 515,959
  • 87
  • 875
  • 1,141
LettersBa
  • 747
  • 1
  • 8
  • 27

1 Answers1

0

The simplest approach is to test whether a given point of the drawing is transparent, as I explain here: https://stackoverflow.com/a/3763313/341994

Community
  • 1
  • 1
matt
  • 515,959
  • 87
  • 875
  • 1,141