From ad4fb381eeb2eb38eb83b7f4288704751c609e01 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: Fri, 16 Oct 2026 13:49:07 +0300 Subject: [PATCH] some --- components/root/mac/view/RootView.swift | 24 ++++++++++++++++++++++++ components/root/root.swift | 15 +++++++++++++++ components/root/rootVM.swift | 11 +++++++++++ 3 files changed, 50 insertions(+) create mode 100644 components/root/mac/view/RootView.swift create mode 100644 components/root/root.swift create mode 100644 components/root/rootVM.swift diff --git a/components/root/mac/view/RootView.swift b/components/root/mac/view/RootView.swift new file mode 100644 index 0000000..ccd1ea7 --- /dev/null +++ b/components/root/mac/view/RootView.swift @@ -0,0 +1,24 @@ +import SwiftUI + +struct RootView: View { + @ObservedObject var vm: RootVM + + init(_ vm: RootVM) { + self.vm = vm + } + + var body: some View { + VStack(spacing: 16) { + Text("Hello, World!") + .font(.largeTitle) + + Text(vm.countText) + .font(.title3.monospacedDigit()) + + Button("Increment") { + rootSet(F.didClickIncrement, true) + } + } + .padding(40) + } +} diff --git a/components/root/root.swift b/components/root/root.swift new file mode 100644 index 0000000..7f17acd --- /dev/null +++ b/components/root/root.swift @@ -0,0 +1,15 @@ +class RootComponent { + let ctrl = DialectController(RootContext()) + static private(set) weak var singleton: RootComponent? + + init() { + Self.singleton = self + rootRegisterEffects(ctrl) + rootRegisterShoulds(ctrl) + otherSetupConsoleLogging(ctrl, "Root") + } + + func setup() { + rootSet(F.didSetup, true) + } +} diff --git a/components/root/rootVM.swift b/components/root/rootVM.swift new file mode 100644 index 0000000..5823662 --- /dev/null +++ b/components/root/rootVM.swift @@ -0,0 +1,11 @@ +import Combine + +final class RootVM: ObservableObject { + @Published var countText = "" + + static private(set) weak var shared: RootVM? + + init() { + Self.shared = self + } +}