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

+ 24
- 13
src/App.swift 查看文件

@@ -8,6 +8,10 @@ import UIKit
struct Content: View {
@State private var selectedId = "1"
var ids = ["1", "2", "3", "4"]

@StateObject var adates = BusUI.Value(Mic.K.activityDates, [String: Date]())
var keys: [String] { Array(adates.v.keys) }

var body: some View {
VStack {
HStack {
@@ -25,8 +29,8 @@ struct Content: View {
Divider()
.padding()
List {
ForEach(ids, id: \.self) {
Text("\($0): TODO state")
ForEach(keys, id: \.self) {
Text("\($0): \(String(describing: adates.v[$0]))")
}
}
}
@@ -103,18 +107,25 @@ class AppDelegate: UIResponder, UIApplicationDelegate
}
func testMic4() {
let ad1 = [
"1": Date().addingTimeInterval(3),
"2": Date().addingTimeInterval(5),
]
Bus.send(Mic.K.activityDates, ad1)

DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
let ad2 = [
"1": Date().addingTimeInterval(3),
"4": Date().addingTimeInterval(5),
]
Bus.send(Mic.K.activityDates, ad2)
Bus.send(
Mic.K.activityDates,
[
"1": Date().addingTimeInterval(3),
"2": Date().addingTimeInterval(5),
]
)
}

DispatchQueue.main.asyncAfter(deadline: .now() + 4) {
Bus.send(
Mic.K.activityDates,
[
"1": Date().addingTimeInterval(2),
"4": Date().addingTimeInterval(5),
]
)
}

}
}

Loading…
取消
儲存