try the following animation in a different condition, this will work fine if you have already completed the translation of the if condition.
[UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.4]; selectedCell.transform=CGAffineTransformMakeTranslation(70, 0); [UIView commitAnimations]; [slideArray replaceObjectAtIndex:indexPath.row withObject:[NSNumber numberWithInt:0]];
if the above code does not work for you than try the following
[UIView animateWithDuration:0.5 delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:(void (^)(void)) ^{ myImageView.transform=CGAffineTransformMakeTranslation(-70, 0); } completion:^(BOOL finished){ myImageView.transform=CGAffineTransformIdentity; }]; [slideArray replaceObjectAtIndex:indexPath.row withObject:[NSNumber numberWithInt:0]];
let me know if there are any problems .. Regards.
source share