From d81012e5fc7839662cbd4f9d783f93fc41af11c8 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: Tue, 23 Jan 2024 19:18:59 +0300 Subject: [PATCH] d --- Modules/MicX/MicItem/src/MicItem.V.swift | 3 ++- src/App.swift | 29 ++++++++++++++++++++---- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/Modules/MicX/MicItem/src/MicItem.V.swift b/Modules/MicX/MicItem/src/MicItem.V.swift index ae18215..6828850 100644 --- a/Modules/MicX/MicItem/src/MicItem.V.swift +++ b/Modules/MicX/MicItem/src/MicItem.V.swift @@ -6,9 +6,10 @@ extension MicItem { var id: String? @StateObject var isActive = BusUI.Value(K.isActive, false) let proc: [Any] - + public init(_ id: String? = nil) { self.id = id + /**/print("ИГР MicIV.init id: '\(id)'") self.proc = [ Bus.Delay(shouldResetTimeout, K.MI, K.timeout, id), Bus.Sync(shouldResetActivity, K.MI, K.isActive, id), diff --git a/src/App.swift b/src/App.swift index 2e0c001..2d5910b 100644 --- a/src/App.swift +++ b/src/App.swift @@ -6,10 +6,31 @@ import SwiftUI import UIKit struct Content: View { + @State private var selectedId = "1" + var ids = ["1", "2", "3", "4"] var body: some View { - MicItem.V() - MicItem.V("1") - MicItem.V("2") + VStack { + HStack { + Text("MicItem id:") + Picker("", selection: $selectedId) { + ForEach(ids, id: \.self) { + Text($0) + } + } + } + .pickerStyle(.segmented) + Divider() + .padding() + MicItem.V(selectedId) + Divider() + .padding() + List { + ForEach(ids, id: \.self) { + Text("\($0): TODO state") + } + } + } + .padding() } } @@ -32,7 +53,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate window?.makeKeyAndVisible() /**/print("ИГР App.didFLWO") - testMic1() + //testMic1() //testMic2() testMic2_id("1") DispatchQueue.main.asyncAfter(deadline: .now() + 3) {