From 777f340fb87359874c95fc32842ba57303c86646 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, 3 Nov 2026 22:41:49 +0300 Subject: [PATCH] sym --- components/hp/windows/hpVM.swift | 11 ++++++++++ components/hp/windows/view/HPView.swift | 22 +++++++++++++++++++ docs/hello-platform.md | 4 ++-- .../ver-windows/src/hp/hp.swift | 2 +- .../ver-windows/src/hp/hpVM.swift | 2 +- .../ver-windows/src/hp/view/HPView.swift | 2 +- 6 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 components/hp/windows/hpVM.swift create mode 100644 components/hp/windows/view/HPView.swift diff --git a/components/hp/windows/hpVM.swift b/components/hp/windows/hpVM.swift new file mode 100644 index 0000000..52d8f3e --- /dev/null +++ b/components/hp/windows/hpVM.swift @@ -0,0 +1,11 @@ +import SwiftCrossUI + +final class HPVM: ObservableObject { + @Published var countText = "" + + static private(set) weak var shared: HPVM? + + init() { + Self.shared = self + } +} diff --git a/components/hp/windows/view/HPView.swift b/components/hp/windows/view/HPView.swift new file mode 100644 index 0000000..dde17f7 --- /dev/null +++ b/components/hp/windows/view/HPView.swift @@ -0,0 +1,22 @@ +import SwiftCrossUI + +struct HPView: View { + @State var vm: HPVM + + init(_ vm: HPVM) { + self.vm = vm + } + + var body: some View { + VStack(spacing: 16) { + Text("Hello, platform!") + .font(.largeTitle) + Text(vm.countText) + .font(.title3.monospaced()) + Button("Increment") { + hpSet(F.didClickIncrement, true) + } + } + .padding(40) + } +} diff --git a/docs/hello-platform.md b/docs/hello-platform.md index c345250..916eb5c 100644 --- a/docs/hello-platform.md +++ b/docs/hello-platform.md @@ -227,8 +227,8 @@ by this packaging step. ## Windows (WinUI) `ver-windows/` mirrors the Linux SwiftCrossUI target with `WinUIBackend`. -It shares the counter component, model, view, and generated Swift dialect via -relative symlinks. Check out the repository with Git symlinks enabled on Windows +It shares the counter component and generated Swift dialect via +relative symlinks. Its SwiftCrossUI model and view live in `components/hp/windows`. Check out the repository with Git symlinks enabled on Windows (Developer Mode or appropriate symlink permissions are needed). With the Windows Swift toolchain, Windows SDK, and the Windows App SDK runtime diff --git a/hello/hello-platform/ver-windows/src/hp/hp.swift b/hello/hello-platform/ver-windows/src/hp/hp.swift index 3df34ea..b83cde2 120000 --- a/hello/hello-platform/ver-windows/src/hp/hp.swift +++ b/hello/hello-platform/ver-windows/src/hp/hp.swift @@ -1 +1 @@ -../../../../../components/hp/linux/hp.swift \ No newline at end of file +../../../../../components/hp/hp.swift \ No newline at end of file diff --git a/hello/hello-platform/ver-windows/src/hp/hpVM.swift b/hello/hello-platform/ver-windows/src/hp/hpVM.swift index 7394425..0896026 120000 --- a/hello/hello-platform/ver-windows/src/hp/hpVM.swift +++ b/hello/hello-platform/ver-windows/src/hp/hpVM.swift @@ -1 +1 @@ -../../../../../components/hp/linux/hpVM.swift \ No newline at end of file +../../../../../components/hp/windows/hpVM.swift \ No newline at end of file diff --git a/hello/hello-platform/ver-windows/src/hp/view/HPView.swift b/hello/hello-platform/ver-windows/src/hp/view/HPView.swift index 1b79f15..0b0610b 120000 --- a/hello/hello-platform/ver-windows/src/hp/view/HPView.swift +++ b/hello/hello-platform/ver-windows/src/hp/view/HPView.swift @@ -1 +1 @@ -../../../../../../components/hp/linux/view/HPView.swift \ No newline at end of file +../../../../../../components/hp/windows/view/HPView.swift \ No newline at end of file