I'm new to Objective-C and Xcode, and I'm trying to learn something new. Is there a way to read a string from stdin using swift? Something like cin in C ++?
As with Objective-C, you can use NSFileHandle :
NSFileHandle
let standardInput = NSFileHandle.fileHandleWithStandardInput() let input = standardInput.availableData