Seems there is a bug actually when trying to implement a Custom presenter row.
Dunno If it's related to Swift itself, because it's seems to be related to this radar:
https://bugs.swift.org/browse/SR-708
The workaround doesn't work in my project, and I think I'm not alone as you can see this topic on Stackoverflow:
http://stackoverflow.com/questions/39866533/how-to-implement-custom-presenter-rows
I tried on Xcode 8.0 and updated to 8.1, same issue
Try to paste the following sample code (from Eureka documentation) to reproduce the issue:
public final class CustomPushRow<T: Equatable>: SelectorRow<PushSelectorCell<T>, SelectorViewController<T>>, RowType {
public required init(tag: String?) {
super.init(tag: tag)
presentationMode = .show(controllerProvider: ControllerProvider.callback {
return SelectorViewController<T>(){ _ in }
}, completionCallback: { vc in
vc.navigationController?.popViewController(animated: true)
})
}
}
Just ran into the very same issue. All the Eureka examples use segues.
yes. same issues here.
Ran into the same issue.
For now either use segues or this:
form = Section("Section1")
<<< ButtonRow() { row in
row.title = "Show VC"
$0.onCellSelection(self.showVC)
}
.cellUpdate { cell, row in
cell.textLabel?.textAlignment = .left
cell.accessoryType = .disclosureIndicator
}
func showVC(_ cell: ButtonCellOf<String>, row: ButtonRow) {
let yourVC = YourViewController()
navigationController?.show(yourVC, sender: self)
}
The example code works with the following change:
presentationMode = PresentationMode.show(controllerProvider: ControllerProvider.callback {
...
}, onDismiss: { vc in
Note: I added the PresentationMode before
.showand then Xcode suggested changingcompletionCallbacktoonDismiss. PuttingPresentationModebefore.showis actually not needed.
I will update the Readme, sorry for the inconvenience.
Most helpful comment
The example code works with the following change:
I will update the Readme, sorry for the inconvenience.