Skip to content

Make terminal applications quickly with ncurses + Swift

License

Notifications You must be signed in to change notification settings

Jomy10/SwiftCurses

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftCurses

examples | documentation


SwiftCurses is a Swifty wrapper for ncurses.

ncurses - CRT screen handling and optimization package

Hello World

import SwiftCurses

try initScreen() { scr in
    try scr.print("Hello world !!!")
    scr.refresh()
    try scr.getChar()
}

Installation

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"]
)

Documentation / tutorials / links

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.

ncurses info

Running the examples

swift run Examples [name of the example (see main.swift)]

Questions

Feel free to ask any questions.

Contributing

Always looking at improving this library, feel free to leave suggestions/pull requests.

TODO

License

Since the original is licensed under the MIT license, this library is also licensed under the MIT license.