Swiftpack.co - Package - kevinvandenbreemen/inputsAPI-swift

InputsAPI

A simple Swift package for abstracting away inputs and returning promises with user responses. Allows you to focus on writing application logic without worrying about details like UI popups, inputs, etc.

This is still a work in progress.

Usage

Command line Input

Be sure to import InputsAPI

let input: InputsAPI = InputsAPIImpl()  //  Currently default (and only) implementation is console input

let choices = ["Select A", "Select B", "Select C"]
input.selectOption("Pick One?", choices: choices).then{ selection in 
    print("Chose \(choices[selection])")
}

Command line Output

Be sure to import OutputsAPI

        let outputsAPI: OutputsAPI = OutputsAPIImpl()
        outputsAPI.printLine("Hello, this is a test")

Github

link
Stars: 0
Help us keep the lights on

Dependencies

Used By

Total: 0

Releases

0.0.4 - Aug 30, 2019

0.0.3 - Aug 29, 2019

Outputs API to abstract direct printing to console or other media

0.0.2 - Aug 28, 2019

0.0.1 - Aug 28, 2019