3

I want to take user input from command line. I'm using readLine() but I'm unable give any input.

Ahmad F
  • 30,560
  • 17
  • 97
  • 143
Randhir
  • 45
  • 1
  • 2
  • 2
    See http://stackoverflow.com/questions/36937436/exc-i386-gpflt-in-swift-code-using-xcode-playground. There's no way to use command line user input in a Playground. It only works in a real command line application. – Eric Aya Dec 07 '16 at 10:52

3 Answers3

1

In playground it is not possible to take an input from user. Playground is just a launcher of your swift code.

sorry!

Muhammadjon
  • 190
  • 2
  • 11
1

Create a playground with a Single View and add a UITextView and an enter button.

uplearned.com
  • 3,393
  • 5
  • 44
  • 59
0

Declare it in following way Var a = readLine()

Yash Chitroda
  • 645
  • 4
  • 8
  • 27