mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
28 lines
614 B
Swift
28 lines
614 B
Swift
import SwiftUI
|
|
import VGSL
|
|
|
|
struct ScannerView: UIViewControllerRepresentable {
|
|
private let disposePool = AutodisposePool()
|
|
|
|
@Binding
|
|
var result: String
|
|
|
|
func makeUIViewController(context _: Context) -> UIViewController {
|
|
let controller = ScannerViewController(
|
|
logError: { message in
|
|
AppLogger.error(message)
|
|
}
|
|
)
|
|
controller.result.currentAndNewValues
|
|
.addObserver {
|
|
if result != $0 {
|
|
result = $0
|
|
}
|
|
}
|
|
.dispose(in: disposePool)
|
|
return controller
|
|
}
|
|
|
|
func updateUIViewController(_: UIViewController, context _: Context) {}
|
|
}
|