@@ -6,9 +6,10 @@ extension MicItem { | |||||
var id: String? | var id: String? | ||||
@StateObject var isActive = BusUI.Value(K.isActive, false) | @StateObject var isActive = BusUI.Value(K.isActive, false) | ||||
let proc: [Any] | let proc: [Any] | ||||
public init(_ id: String? = nil) { | public init(_ id: String? = nil) { | ||||
self.id = id | self.id = id | ||||
/**/print("ИГР MicIV.init id: '\(id)'") | |||||
self.proc = [ | self.proc = [ | ||||
Bus.Delay(shouldResetTimeout, K.MI, K.timeout, id), | Bus.Delay(shouldResetTimeout, K.MI, K.timeout, id), | ||||
Bus.Sync(shouldResetActivity, K.MI, K.isActive, id), | Bus.Sync(shouldResetActivity, K.MI, K.isActive, id), | ||||
@@ -6,10 +6,31 @@ import SwiftUI | |||||
import UIKit | import UIKit | ||||
struct Content: View { | struct Content: View { | ||||
@State private var selectedId = "1" | |||||
var ids = ["1", "2", "3", "4"] | |||||
var body: some View { | 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() | window?.makeKeyAndVisible() | ||||
/**/print("ИГР App.didFLWO") | /**/print("ИГР App.didFLWO") | ||||
testMic1() | |||||
//testMic1() | |||||
//testMic2() | //testMic2() | ||||
testMic2_id("1") | testMic2_id("1") | ||||
DispatchQueue.main.asyncAfter(deadline: .now() + 3) { | DispatchQueue.main.asyncAfter(deadline: .now() + 3) { | ||||