LiteRoute
LiteRoute copied to clipboard
Module output
Как реализовать module output при переходе?
Module output пока еще не реализована. Постараюсь в скором времени сделать это :)
@zarochintsev Реализация по moduleOutput добавил. Лично я считаю, что в ней есть некоторые проблемы. Более подробный тест я не проводил, но в ближайшее время попытаюсь проделать эту работу и добавить документацию.
@SpectralDragon Я так и не понял, как можно реализовать moduleOutput?
@SpectralDragon
Скажем у меня есть следующий код:
func openScannerModule() {
try? transitionHandler
.forSegue(identifier: C.SegueIdentifiers.scannerModule, to: ScannerModuleInput.self)
.then { moduleInput in
moduleInput.configure()
}
}
@zarochintsev самое простое решение:
func openScannerModule(output: ScannerModuleOutput) {
try? transitionHandler
.forSegue(identifier: C.SegueIdentifiers.scannerModule, to: ScannerModuleInput.self)
.then { moduleInput in
moduleInput.configure(output: ScannerModuleOutput)
}
}
class ScannerModulePresenter: ScannerModuleInput {
...
var output: ScannerModuleOutput?
func configure(output: ScannerModuleOutput) {
self.output = output
}
...
}
@Ikloo у меня сейчас так и реализовано