First of all, much gratitude to atebits for their very informative blog post Fast Scrolling in Tweetie with UITableView. The post explains in detail how
For fully control on editing in your custom cell, you should override willTransitionToState method in your UITableViewCell subclass and check state mask
- (void)willTransitionToState:(UITableViewCellStateMask)state
{
NSString *logStr = @"Invoked";
if ((state & UITableViewCellStateShowingEditControlMask)
!= 0) {
// you need to move the controls in left
logStr = [NSString stringWithFormat:@"%@
%@",logStr,@"UITableViewCellStateShowingEditControlMask"];
}
if ((state & UITableViewCellStateShowingDeleteConfirmationMask)
!= 0) {
// you need to hide the controls for the delete button
logStr = [NSString stringWithFormat:@"%@
%@",logStr,@"UITableViewCellStateShowingDeleteConfirmationMask"];
}
NSLog(@"%@",logStr);
[super willTransitionToState:state];
}
also you can override layoutSubviews
- (void)layoutSubviews {
// default place for label
CGRect alarmTimeRect = CGRectMake(37, 7, 75, 30);
if (self.editing && !self.showingDeleteConfirmation) {
// move rect in left
alarmTimeRect = CGRectMake(77, 7, 75, 30);
}
[alarmTimeLabel setFrame:alarmTimeRect];
[super layoutSubviews];
}