tags:

views:

159

answers:

1

In -drawRect: I want to check if the provided rect intersects with anotherRect.

I'm not good at this geometry math stuff and especially at english so what I want to say is:

If you have two sheets of paper on the desk, and one of them covers the other either completely or just a small portion, it is rectsIntersect = YES.

How to check that out for rect and anotherRect?

+7  A: 

Use bool CGRectIntersectsRect (CGRect rect1,CGRect rect2);

Matt Greer
Here is a blog post that talks about it: http://blogs.oreilly.com/iphone/2008/12/useful-core-graphics-functions.html
Matt Greer
Thanks Brandon, he has the correct signature (which I did not)
Matt Greer
No problem, just didn't want someone swooping in with the correct name and taking your answer. :)
Brandon Bodnár