I've researched this across but dont seem to have found a solution yet. I have a custom UITableViewCell (with various subviews, including a radio button, labels, etc.). I would like the + and - insert / delete editing controls to appear at the left-most part of the cell when the table view is set to editing.
If I used the standard UITableViewCell, this works perfectly. However, whilst using the custom cell, the controls just dont appear. Anyone has any ideas on how to fix the same please?
Below are some snapshots of my table view code....
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (self.isEditing) {
if ([tableView isEqual:self.tableView]) {
if (editingStyle == UITableViewCellEditingStyleInsert) {
// ...
}
else if (editingStyle == UITableViewCellEditingStyleDelete) {
// ...
}
}
}
}
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([tableView isEqual:self.tableView]) {
if (indexPath.row == 0) {
return UITableViewCellEditingStyleInsert;
}
else {
return UITableViewCellEditingStyleDelete;
}
}
else {
return UITableViewCellEditingStyleNone;
}
}
And the custom table view cell code...
- (void)awakeFromNib
{
[super awakeFromNib];
}
- (void)setEditing:(BOOL)editing animated:(BOOL)animated
{
[self setNeedsLayout];
}
- (void)layoutSubviews
{
[super layoutSubviews];
[self configureConstraints];
}
- (void)configureConstraints
{
// This is where the cell subviews are laid out.
}