Custom Edit View in Uitableviewcell While Swipe Left. Objective-C or Swift

Insert / Delete editing controls not appearing while editing custom UITableViewCell

You didn't implement the setEditing:animated: method correctly in your custom cell. You forgot to call super:

- (void)setEditing:(BOOL)editing animated:(BOOL)animated
{
[super setEditing:editing animated:animated];

[self setNeedsLayout];
}

It's a rare overridden method that you don't call super.

Unrelated - in your table view code, don't use isEqual: to compare the two table views, use ==.

if (tableView == self.tableView) {

You actually do want to see if they are the same pointers.

How to customize tableView edit mode ios

When putting a UITableViewin editing mode using setEditing(_:animated:), “the table view goes into editing mode by calling setEditing(_:animated:) on each visible UITableViewCell object” according to Apple’s UITableViewdocumentation. You could create a custom UITableViewCell subclass and override setEditing(_:animated:) there, using custom image views holding your versions of the circle and hamburger symbols inside your cell’s XIB.

How to edit tableview cell on TAP instead of swipe - Swift

I don't think you're going to be able to do it, sorry. This feature relies on the UITableView's pan gesture recognizer. When the user pans sideways, the table view checks the editActions... delegate method and, if we have edit actions, inserts a private confirmation view behind the cell and allows the cell to be moved to reveal it. You can't trigger that behavior programmatically as far as I can tell.

This would be a reason — one of many very good reasons — for sticking with a third-party scrollable cell class. In this way, the cell is a horizontal scroll view and you just scroll it in code.



Related Topics



Leave a reply



Submit