iOS自定义按钮删除Cell

来源:互联网 发布:阿里云实名认证api 编辑:程序博客网 时间:2024/06/05 00:54

[cell.myignore addTarget:self action:@selector(removeCell:) forControlEvents:UIControlEventTouchUpInside];

#pragma mark - 点击删除按钮删除Cell

- (void)removeCell:(UIButton *)btn{

    NSArray *visibleCells=[self.myTableView visibleCells];

    for (UITableViewCell *cell in visibleCells) {

        if (cell.tag==btn.tag) {

            [self.cellInfoArray removeObjectAtIndex:[cell tag]];

            [self.myTableView reloadData];

            break;

        }

    }

}

0 0
原创粉丝点击