macos: iOS app can initialize Ghostty

This commit is contained in:
Mitchell Hashimoto
2024-01-14 14:44:16 -08:00
parent 87f5d6f6a8
commit 4d9fd2becc
4 changed files with 231 additions and 0 deletions

View File

@@ -2,14 +2,19 @@ import SwiftUI
@main
struct Ghostty_iOSApp: App {
@StateObject private var ghostty_app = Ghostty.App()
var body: some Scene {
WindowGroup {
iOS_ContentView()
.environmentObject(ghostty_app)
}
}
}
struct iOS_ContentView: View {
@EnvironmentObject private var ghostty_app: Ghostty.App
var body: some View {
VStack {
Image("AppIconImage")
@@ -17,6 +22,7 @@ struct iOS_ContentView: View {
.aspectRatio(contentMode: .fit)
.frame(maxHeight: 96)
Text("Ghostty")
Text("State: \(ghostty_app.readiness.rawValue)")
}
.padding()
}