6

I am using quickdialog for a form and I am trying to implement swipe to delete and have no idea how I would do that. Can anybody help me?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
BObereder
  • 1,046
  • 1
  • 13
  • 29

2 Answers2

2

You can swipe to delete elements in a section by using QSortingSection in place of QSection and setting canDeleteRows to YES.

QSortingSection *foosection = [[QSortingSection alloc] init];
foosection.canDeleteRows = YES;

Proceed to add elements as usual and you should be able to swipe each element to have a "delete" button appear. Upon hitting the delete button, the item automatically disappears from the section.

Eric Baker
  • 21
  • 2
1

The answer is I think a combination of: How to detect Swipe Gesture in iPhone SDK?

And, probably the bit you are really worried about, how to Add/remove new QElement to the section (from a github issue).

The latter suggests that the way to remove elements, in this example extraRepayAmount, from a section is this:

[self.extraRepaySection.elements removeObject:self.extraRepayAmount];
[self.quickDialogTableView reloadSections:[NSIndexSet indexSetWithIndex:2] withRowAnimation:UITableViewRowAnimationFade];
Community
  • 1
  • 1