macos: starting boilerplate

This commit is contained in:
Mitchell Hashimoto
2023-02-12 21:36:27 -08:00
parent caa27fcf98
commit f2948fd6a6
3 changed files with 51 additions and 0 deletions

9
macos/.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
DerivedData/
.swiftpm/config/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc

19
macos/Package.swift Normal file
View File

@ -0,0 +1,19 @@
// swift-tools-version: 5.7
// The swift-tools-version declares the minimum version of Swift required to
// build this package.
import PackageDescription
let package = Package(
name: "Ghostty",
platforms: [
// SwiftUI
.macOS(.v11),
],
dependencies: [],
targets: [
.executableTarget(
name: "Ghostty",
dependencies: []),
]
)

View File

@ -0,0 +1,23 @@
import SwiftUI
@main
struct Ghostty: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
struct ContentView: View {
@StateObject var viewModel: ViewModel = ViewModel()
var body: some View {
TextField("", text: $viewModel.inputText)
.padding()
}
}
public class ViewModel: ObservableObject {
@Published var inputText: String = ""
}