views:

350

answers:

1

I have a custom UITableViewCell which has an image & and some text. When entering editing mode, I would like the image to fade out & move offscreen to the left. When & how do I implement this code? I tried putting an animation block in willTransitionToState: but the image simply jumps offscreen w/ no animation.

+1  A: 

Override setEditing:animated: to do this type of thing. Make sure you don't animate if animated is NO. Like so:

if( animated ) {
    [UIView beginAnimations:@"EnterEditingMode" context:NULL];
    // Set up duration, etc here
}

if( editing ) {
    // do animation
} else {
    // reverse animation
}

if( animated ) {
    [UIView commitAnimations];
}
Steven Canfield
Kyle Decot
Isn't it being executed with `editing=NO` and `animated=NO`? Which should just be your default state. Check your logic.
Steven Canfield