Create hello-platform for macOS (#10)

Co-authored-by: Михаил Капелько <kornerr@gmail.com>
This commit is contained in:
kornerr authored and Михаил Капелько committed 2026-11-01 05:01:36 +01:00
1 parent 8913022044
commit 1aa218d0bb
186 files changed
+519 -7

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
class HPComponent {
let ctrl = DialectController(HPContext())
static private(set) weak var singleton: HPComponent?
init() {
Self.singleton = self
hpRegisterEffects(ctrl)
hpRegisterShoulds(ctrl)
}
func setup() {
hpSet(F.didSetup, true)
}
}
+11
View File
@@ -0,0 +1,11 @@
import Combine
final class HPVM: ObservableObject {
@Published var countText = ""
static private(set) weak var shared: HPVM?
init() {
Self.shared = self
}
}
+22
View File
@@ -0,0 +1,22 @@
import SwiftUI
struct HPView: View {
@ObservedObject 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.monospacedDigit())
Button("Increment") {
hpSet(F.didClickIncrement, true)
}
}
.padding(40)
}
}