Is there a notification or delegate method that I can use to detect when the table view goes into the editing state?
What I want to do is detect that the table is editing and then display an extra row that says "Add new item" or something like that.
I tried adding the "Add New Item" row at the end of the array when the View Controller is loaded and then depending on whether [tableView isEditing] is true or not, either return [array count] (for when I am editing) or [array count] - 1 (for when I am not editing).
Any ideas? What is the way Apple edits items in the table and allows for deletion?
I found it. Override this method:
- (void)setEditing:(BOOL)editing animated:(BOOL)animated{
[super setEditing:editing animated:animated];
// do something
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With