Entering and exiting UITableView edit mode has a cool animation. If you've got a custom subclass, your goodies don't move unless you overridelayoutSubviews
in your UITableViewCell subclass. Any view position changes will automatically be animated.- (void) layoutSubviews { // skootch stuff over if (self.editing && !self.showingDeleteConfirmation) { #define MARGIN 40.0 CGRect frame = CGRectMake (MARGIN + 4.0, 4.0, 70.0, 46.0); _profileView.frame = frame; frame = CGRectMake (MARGIN + 80.0, 0, 240.0 - MARGIN, 55.0); _titleLabel.frame = frame; // layout normally } else { CGRect frame = CGRectMake (4.0, 4.0, 70.0, 46.0); _profileView.frame = frame; frame = CGRectMake (80.0, 0, 240.0, 55.0); _titleLabel.frame = frame; } [super layoutSubviews]; } // layoutSubviewsTheshowingDeleteConfirmation
test is so you don't move things around if the user does the "swipe-right to show delete button" thing.