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?
How to implement swipe to delete with quickdialog
Asked Answered
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.
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];
© 2022 - 2024 — McMap. All rights reserved.