Rect Is Visible?

Discussion in 'iPhone/iPad Programming' started by Molten, Nov 4, 2009.

  1. macrumors newbie

    Joined:
    Oct 20, 2009
    #1
    Hey, I've got a question for you all.

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

    background.
    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

    Joined:
    Oct 20, 2009
    #2
    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