From d5d16cd6275f52da940153a447e81f45055409af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9A=D0=B0=D0=BF?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BA=D0=BE?= Date: Thu, 25 Jan 2024 19:22:43 +0300 Subject: [PATCH] d --- src/App.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/App.swift b/src/App.swift index bcad986..1dbdd4c 100644 --- a/src/App.swift +++ b/src/App.swift @@ -10,7 +10,10 @@ struct Content: View { var ids = ["1", "2", "3", "4"] @StateObject var adates = BusUI.Value(Mic.K.activityDates, [String: Date]()) - var keys: [String] { Array(adates.v.keys) } + + func val(_ k: String) -> Date { + adates.v[k] ?? .distantPast + } var body: some View { VStack { @@ -29,8 +32,8 @@ struct Content: View { Divider() .padding() List { - ForEach(keys, id: \.self) { - Text("\($0): \(String(describing: adates.v[$0]))") + ForEach(ids, id: \.self) { + Text("\($0): \(val($0).timeIntervalSince1970)") } } }