SwiftTUI is framework for easily build TUI with swift.
import SwiftTUI
struct Main: View {
@State var model = Main.ViewModel
var body: some View {
List(model.items, action: model.selectItem) { item in
Triangle()
VStack(alignment: .leading) {
Text(item.title)
Text(item.subTitle)
.color(.gray)
}
}
}
}
Great helpful stackoverflow exists. reference from https://stackoverflow.com/questions/56251835/swift-package-manager-unable-to-compile-ncurses-installed-through-homebrew. This section is quoted above stackoverflow links.
Required ncurses version is over 6.1. See also HOW TO INSTALL ncurses on MacOSX
- DEBUG_LOGGER_PATH: SwiftTUI debug log path. e.g) ~/development/SwiftTUI/debug.log.d
- PKG_CONFIG_PATH: your ncurses package config file path. e.g) "/usr/local/opt/ncurses/lib/pkgconfig"
If you want to generate a Xcode project, use the following command:
swift package generate-xcodeproj
SwiftTUI is available under the MIT license. See the LICENSE file for more info.