SwiftCurses is a Swifty wrapper for ncurses.
ncurses - CRT screen handling and optimization package
import SwiftCurses
try initScreen() { scr in
try scr.print("Hello world !!!")
scr.refresh()
try scr.getChar()
}
ncurses must be installed on the system.
In your swift package:
dependencies: [
.package(url: "https://github.com/jomy10/SwiftCurses.git", branch: "master")
]
In a swift target:
.target(
name: "MyTarget",
dependencies: ["SwiftCurses"]
)
There is a great ncurses tutorial you can find here, the examples in this repository show the examples seen in the tutorial.
NCurses documentation can be found here, though keep in mind some functions may be missing/have a different name.
swift run Examples [name of the example (see main.swift)]
Feel free to ask any questions.
Always looking at improving this library, feel free to leave suggestions/pull requests.
- border: https://invisible-island.net/ncurses/man/curs_border.3x.html
- scr_dump: https://invisible-island.net/ncurses/man/curs_scr_dump.3x.html
- https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/otherlib.html
- fill in the todos
Since the original is licensed under the MIT license, this library is also licensed under the MIT license.