How to implement swipe to delete with quickdialog
Asked Answered
A

2

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?

Afteryears answered 27/1, 2013 at 15:34 Comment(0)
T
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.

Taxable answered 29/12, 2013 at 23:43 Comment(0)
D
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];
Duclos answered 8/4, 2013 at 23:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.