SwiftKotlin
SwiftKotlin copied to clipboard
let function inside lambda is translated to val
if let intent = coordinator.methodName(param1: param1, param2: param2, onComplete: {
self.view.let { self.navigationManager.dismiss(view: $0, animated: true) }
}) {
navigationManager.show(intent, animation: .present)
}
Translated:
val intent = coordinator.methodName(param1: param1, param2: param2, onComplete = {
this.view.val { this.navigationManager.dismiss(view = it, animated = true) }
})
if (intent != null) {
navigationManager.show(intent, animation = .present)
}
Correct Translate:
val intent = coordinator.methodName(param1: param1, param2: param2, onComplete = {
this.view?.let { this.navigationManager.dismiss(view = it, animated = true) }
})
if (intent != null) {
navigationManager.show(intent, animation = .present)
}