I know that to program in STDIN and STDOUT, we need to make an command line project in Xcode. But how do I take a standard input in playground.
Whenever I try to run such code in playground
var input = readLine()!
I always get this error
Execution was interrupted, reason: EXC_BAD_INSTRUCTION (Code=EXC_l386_INVOP, subcode=0x0)
Is it possible to take STDIN in playground or not?
UPDATE
I know this error is because of nil input
variable but want to know how to overcome this nil value.