I have posted an example in my blog:
CGPoint originalCenter = icon.center;
[UIView animateWithDuration:2.0
animations:^{
CGPoint center = icon.center;
center.y += 60;
icon.center = center;
}
completion:^(BOOL finished){
[UIView animateWithDuration:2.0
animations:^{
icon.center = originalCenter;
}
completion:^(BOOL finished){
;
}];
}];
The above code will animate a UIImageView* (icon) in a 2-second animation. Once completed, another animation will move the icon back to it’s original position.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…