Swiftpack.co - Package - kevinvandenbreemen/inputsAPI-swift


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.


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


Stars: 0


Used By

Total: 0


Update api naming - 2019-08-30 01:15:57

Provide outputs API as well - 2019-08-29 00:41:44

Outputs API to abstract direct printing to console or other media

Initial attempt at releasing and using in an app - missing public constructor - 2019-08-28 02:14:04

Initial attempt at releasing and using in an app - 2019-08-28 02:10:42