I want to know what I am missing as my cell does not animate when hiding the delete button. The label jumps back to the original position before the delete button finish animating.
When I tap the round editing view to show the delete button, the label animation works:
However when I tap it again to hide the delete button, the movement of the label is not animated:
Note: These screenshot are not created from the following code. But they show the problem.
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
homeCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[homeCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
// Set up the cell
Consumed *drinkObj = [self.appDelegate.consumedDrinksArray objectAtIndex:indexPath.row];
cell.titleLabel.text = drinkObj.drinkName;
NSString *detailTextTime = [NSDate stringFromDate:drinkObj.dateConsumed withFormat:@"h:mma"];
NSString *detailTextrelative = [relativeDateTransformer transformedValue:drinkObj.dateConsumed];
NSString *detailText = [NSString stringWithFormat:@"%@ %@ ", detailTextTime,detailTextrelative];
cell.timeLabel.text = detailText;
cell.stdDLabel.text = @"999.0"; //[NSString stringWithFormat:@"%@", drinkObj.standardDrinks];
cell.stdDLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
cell.titleLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
cell.timeLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}