Rect Is Visible?

Discussion in 'iOS Programming' started by Molten, Nov 4, 2009.

  1. macrumors newbie

    Oct 20, 2009
    Hey, I've got a question for you all.

    How do i determine whether or not a rect is in my scrollviews 'viewing zone' (bounds?) ?

    So i got a big scrollview, and i've got a rectangle in my scrollview. I want a function to start whenever that rectangle is in the view of my scrollview.

    really appreciate any help :)
  2. thread starter macrumors newbie

    Oct 20, 2009
    Ok, i figured it out... so easy that i'm embarrassed..

    CGRectIntersectsRect( myRect.frame, myScrollview.bounds);

    BUT!, this put me in another situation, the bounds of my scrollview doesn't change with zooming. so the intersection will only happen if the original sized bounds intersects.. (upper left corner of my (out)zoomed scrollview)

Share This Page