diff --git a/macos/.gitignore b/macos/.gitignore new file mode 100644 index 000000000..3b2981208 --- /dev/null +++ b/macos/.gitignore @@ -0,0 +1,9 @@ +.DS_Store +/.build +/Packages +/*.xcodeproj +xcuserdata/ +DerivedData/ +.swiftpm/config/registries.json +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +.netrc diff --git a/macos/Package.swift b/macos/Package.swift new file mode 100644 index 000000000..d85ec4af0 --- /dev/null +++ b/macos/Package.swift @@ -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: []), + ] +) diff --git a/macos/Sources/Ghostty/main.swift b/macos/Sources/Ghostty/main.swift new file mode 100644 index 000000000..0354fb9a8 --- /dev/null +++ b/macos/Sources/Ghostty/main.swift @@ -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 = "" +}