Михаил Капелько 10 个月前
父节点
当前提交
895f74440b
共有 1 个文件被更改,包括 17 次插入0 次删除
  1. +17
    -0
      Modules/BusX/BusUI/src/BusUI.TextField.swift

+ 17
- 0
Modules/BusX/BusUI/src/BusUI.TextField.swift 查看文件

@@ -3,13 +3,30 @@ import SwiftUI

extension BusUI {
public final class TextField: ObservableObject {
let textApp: String
let textUI: String
@Published public var id: String?
@Published public var v = "a:"
var subscriptions = [AnyCancellable]()
var sub = [AnyCancellable]()
public init(
_ textApp: String,
_ textUI: String
) {
self.textApp = textApp
self.textUI = textUI

$id
.sink { [weak self] v in self?.setup(v) }
.store(in: &sub)
}

private func setup(_ id: String?) {
/**/print("ИГР BusUTF(\(Unmanaged.passUnretained(self).toOpaque())).setup id: '\(id)'")

subscriptions = []

Bus.sendSync(
textUI,
$v


正在加载...
取消
保存