3

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

Ahmad F
  • 28,447
  • 13
  • 87
  • 133
Randhir
  • 45
  • 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
  • 182
  • 1
  • 8
0

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

uplearned.com
  • 3,275
  • 5
  • 42
  • 58
0

Declare it in following way Var a = readLine()

Yash Chitroda
  • 598
  • 4
  • 6
  • 25