d
This commit is contained in:
@@ -8,6 +8,10 @@ import UIKit
|
|||||||
struct Content: View {
|
struct Content: View {
|
||||||
@State private var selectedId = "1"
|
@State private var selectedId = "1"
|
||||||
var ids = ["1", "2", "3", "4"]
|
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 {
|
var body: some View {
|
||||||
VStack {
|
VStack {
|
||||||
HStack {
|
HStack {
|
||||||
@@ -25,8 +29,8 @@ struct Content: View {
|
|||||||
Divider()
|
Divider()
|
||||||
.padding()
|
.padding()
|
||||||
List {
|
List {
|
||||||
ForEach(ids, id: \.self) {
|
ForEach(keys, id: \.self) {
|
||||||
Text("\($0): TODO state")
|
Text("\($0): \(String(describing: adates.v[$0]))")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -103,18 +107,25 @@ class AppDelegate: UIResponder, UIApplicationDelegate
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testMic4() {
|
func testMic4() {
|
||||||
let ad1 = [
|
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
|
||||||
|
Bus.send(
|
||||||
|
Mic.K.activityDates,
|
||||||
|
[
|
||||||
"1": Date().addingTimeInterval(3),
|
"1": Date().addingTimeInterval(3),
|
||||||
"2": Date().addingTimeInterval(5),
|
"2": Date().addingTimeInterval(5),
|
||||||
]
|
]
|
||||||
Bus.send(Mic.K.activityDates, ad1)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
|
DispatchQueue.main.asyncAfter(deadline: .now() + 4) {
|
||||||
let ad2 = [
|
Bus.send(
|
||||||
"1": Date().addingTimeInterval(3),
|
Mic.K.activityDates,
|
||||||
|
[
|
||||||
|
"1": Date().addingTimeInterval(2),
|
||||||
"4": Date().addingTimeInterval(5),
|
"4": Date().addingTimeInterval(5),
|
||||||
]
|
]
|
||||||
Bus.send(Mic.K.activityDates, ad2)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user