I am attempting to get the keyboard input for a command line app for the new Apple programming language Swift.
I've scanned the docs to no avail.
import Foundation
println("What is your name?")
???
Any ideas?
The correct way to do this is to use readLine
, from the Swift Standard Library.
Example:
let response = readLine()
Will give you an Optional value containing the entered text.