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

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

  1. ethana macrumors 6502a

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

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



Share This Page