How do I detect when an UIImageView has reached a certain location?

Discussion in 'iOS Programming' started by ethana, Mar 6, 2009.

  1. macrumors 6502a

    Joined:
    Jul 17, 2008
    Location:
    Seattle, WA
    #1
    Ok... I have an UIImageView that is animated. It moves vertically from y at 40 down to 300:

    Code:
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.5];
    imvOne.frame = CGRectMake(imvOne.frame.origin.x, 300, imvOne.frame.size.width, imvOne.frame.size.height);
    [UIView commitAnimations];
    
    Animations run within their own thread, so how do I detect in my code when the UIImageView's location has reached y at 300? With a delegate? Which one and how? I need to perform an action when the UIImageView reaches certain points.

    Thanks,

    Ethan
     

Share This Page