Create hello-platform for Linux (#13)
Co-authored-by: Михаил Капелько <kornerr@gmail.com>
This commit is contained in:
1 parent
45ca185094
commit
614392c921
23 files changed
+4720
-7
No files matched your search
Symlink
+1
@@ -0,0 +1 @@
|
||||
../hp.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
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ struct HPView: View {
|
||||
Text("Hello, platform!")
|
||||
.font(.largeTitle)
|
||||
Text(vm.countText)
|
||||
.font(.title3.monospacedDigit())
|
||||
.font(.title3.monospaced())
|
||||
Button("Increment") {
|
||||
hpSet(F.didClickIncrement, true)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user