Swift Eureka - MultivaluedSection capture reorder action

450 views Asked by At

I am using the Eureka forms library in Swift. I would like to capture the reorder action of the MultivaluedSection. The MultivaluedSection does not have a callback to do this.

This is what one of the MultivaluedSection examples looks like.

form +++
            MultivaluedSection(multivaluedOptions: [.Reorder, .Insert, .Delete],
                               header: "Multivalued TextField",
                               footer: ".Insert multivaluedOption adds the 'Add New Tag' button row as last cell.") {
                $0.addButtonProvider = { section in
                    return ButtonRow(){
                        $0.title = "Add New Tag"
                    }.cellUpdate { cell, row in
                        cell.textLabel?.textAlignment = .left
                    }
                }
                $0.multivaluedRowToInsertAt = { index in
                    return NameRow() {
                        $0.placeholder = "Tag Name"
                    }
                }
                $0 <<< NameRow() {
                    $0.placeholder = "Tag Name"
                }
            }
1

There are 1 answers

0
Seb123 On

This can be done by implementing:

override func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath)