title: How do i convert Swift strings into Integers?
body: <p>I'm trying to make a simple program in swift. Its supposed to get the users input then add it together and then display it again. Im have trouble converting the strings in to integers. Heres my program:</p>
  
  <pre><code>import UIKit
  import Foundation
  var str = "Adding"
  let x = readLine()
  let y = readLine()
  
  //let a = Int(x) ?? 0
  //let b = Int(y) ?? 0
  print(x+y)
  </code></pre>
  
  <p>I've tried a couple different ways but it still doesn't work. Please help, thanks!</p>