I make custom delete button for my TableViewCell
with this method :
- (void)willTransitionToState:(UITableViewCellStateMask)state
{
[super willTransitionToState:state];
if ((state & UITableViewCellStateShowingDeleteConfirmationMask) == UITableViewCellStateShowingDeleteConfirmationMask)
{
for (UIView *subview in self.subviews)
{
NSLog(@"%@",NSStringFromClass([subview class]));
if ([NSStringFromClass([subview class]) isEqualToString:@"UITableViewCellScrollView"])
{
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self
action:@selector(aMethod:)
forControlEvents:UIControlEventTouchUpInside];
[button setTitle:@"remove" forState:UIControlStateNormal];
[button setBackgroundColor:[UIColor yellowColor]];
button.frame = CGRectMake(320, 0, 85.0, 60.0);
[[subview.subviews objectAtIndex:0] addSubview:button];
}
}
}
}
I have one problem. I want my custom button (top button) put instead default delete button. Now when I swipe my cell show two delete button (first default button & second my custom button) how to hide default delete button???