Search code examples
ioseureka-forms

Is it possible to hide delete icon from MultivaluedSection's rows?


;) hi guys!

I want delete function in MultivaluedSection,but I don't want display delete icon in section's rows, something like this:

let section2 =  MultivaluedSection(multivaluedOptions: .Delete, footer: "")
for _ in 1..<4 {
  section2 <<< PickerInlineRow<String> {
                  $0.title = "Tap to select"
                  $0.value = "client"
                  $0.options = nameList
               }
}

demo

I only want user swipe row to delete it.

I try solve it by check in Eureka source code,but can't find any method or property to do this.

FIX: oh!I notice this code in Eureka demo->MultivaluedOnlyDeleteController->viewDidLoad:

tableView.isEditing = false

But,it seem not working at first time.user must tap edit button to reset editing status.

what's wrong with it???


Solution

  • To fix this issue you only have to override the viewWillAppear viewController method

    override func viewWillAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        tableView.isEditing = false
    }
    

    enter image description here