xmartlabs / Eureka

Elegant iOS form builder in Swift
https://eurekacommunity.github.io
MIT License
11.77k stars 1.33k forks source link

onDismissCallback never called #1972

Open GoldenJoe opened 4 years ago

GoldenJoe commented 4 years ago
form
+++ Section("Employees")
<<< MultipleSelectorRow<String>() {
$0.tag = "Employees"
$0.title = ""
$0.options = ["George", "John", "Tom"]
$0.value = []
}
.onPresent { from, to in
   to.onDismissCallback = { _ in
      self.dosomething()
   }
}

The callback never occurs. What is the intended workflow for a callback?

tombeta commented 1 year ago

plus 1

mats-claassen commented 1 year ago

Hi, for MultipleSelectorRow you can override the presentationMode attribute which is set to this by default:

presentationMode = .show(controllerProvider: ControllerProvider.callback {
                return MultipleSelectorViewController<GenericMultipleSelectorRow<T,Cell>>()
        }, onDismiss: { vc in
            let _ = vc.navigationController?.popViewController(animated: true)
        })

Just add your logic in that onDismiss. You should also keep the current logic or modify depending on your needs.