Михаил Капелько 11 months ago
parent
commit
454fbd9686
1 changed files with 24 additions and 13 deletions
  1. +24
    -13
      src/App.swift

+ 24
- 13
src/App.swift View File

@@ -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…
Cancel
Save