Get started with SwiftTUI
mainTo use SwiftTUI, create an executable Swift package and add the repository as a dependency. Use the main branch to access the latest features. Import SwiftTUI in your Swift files and define your UI using views and modifiers similar to SwiftUI.
To launch the application, use the Application struct in your main.swift file, providing a rootView and calling .start().
import SwiftTUI
struct MyTerminalView: View {
var body: some View {
Text("Hello, world!")
}
}
// In main.swift
Application(
rootView: MyTerminalView()
)
.start()