title: Method to get input in console swift
body: <p>How do I read input from console in swift as 'scanf() in c' and 'input() in python'.</p>
  
  <p>I have tried </p>
  
  <pre><code>var ans = readline()
  print(ans) 
  </code></pre>
  
  <p>and its not working</p>
  
  <p>Thanks.</p>