1

So I am trying to make a text-based game, but I cannot find out in the ibook about Swift made by apple how to get input from the console. I have tried a few ways that I saw on here, but I did not really understand how to use those methods.

user3613943
  • 19
  • 1
  • 4

1 Answers1

-1

It doesn't look like there are any input stream facilities in the Swift standard library. But you still have options:

  • import Darwin and use scanf or getc or your favorite POSIX level input routine
  • import Foundation and use NSInputStream, NSScanner etc.
rickster
  • 121,850
  • 25
  • 265
  • 319