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 UITableView
in 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 UITableView
documentation. 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
How to Calculate the Size of a Folder
Create Uiimage With Solid Color in Swift
How to Scale Down a Uiimage and Make It Crispy/Sharp At the Same Time Instead of Blurry
Nsurlconnection and Basic Http Authentication in Ios
Trying to Handle "Back" Navigation Button Action in Ios
Sending Data With Segue With Swift
Anyobject Not Working in Xcode8 Beta6
How to Add an In-App Purchase to an iOS Application
Event Handling For iOS - How Hittest:Withevent: and Pointinside:Withevent: Are Related
Programmatically Align a Toolbar on Top of the Iphone Keyboard
Xcode 4: Create Ipa File Instead of .Xcarchive
Manual Language Selection in an Ios-App (Iphone and Ipad)
How to Use Uivisualeffectview to Blur Image
How to Share an Image on Instagram in Ios
Uipageviewcontroller Gesture Recognizers
How to Import Own Classes from Your Own Project into a Playground