Михаил Капелько 9 月之前
父節點
當前提交
5fad16246a
共有 1 個文件被更改,包括 21 次插入1 次删除
  1. +21
    -1
      src/App.swift

+ 21
- 1
src/App.swift 查看文件

@@ -5,12 +5,32 @@ import MicX
import SwiftUI
import UIKit


class SingularityState {
var value: String?
}

func checkSingularity(_ s: String) -> String? {
var subs = [AnyCancellable]()
let ss = SingularityState()

Bus.receiveSync(
&subs,
["check1"],
{ [weak ss] (_, v: String) in ss?.value = v }
)

Bus.send("check1", "cs\(s)")

return ss.value
}

struct Now: View {
@State var refresh = false
let tm = Timer.publish(every: 0.5, on: .current, in: .common).autoconnect()

var now: String {
"Now: " + String(describing: Int(Date().timeIntervalSince1970))
"Now: " + String(describing: Int(Date().timeIntervalSince1970)) + String(describing: checkSingularity("1"))
}

var body: some View {


Loading…
取消
儲存