title: Swift 1.0 converting string to int error
body: <p>This code worked fine in swift 1.0 except when I tried to run it with swift 2.0 it gave me an error..... Can someone explain why swift is giving me this error and tell me how to fix it?
  (I've already did some digging on stack overflow to try to find the solution but couldn't find it)</p>
  
  <p>Thanks!! heres the code:</p>
  
  <pre><code>class ViewController: UIViewController {@IBOutlet var guess: UITextField!
  
  
  
  
  
  @IBOutlet var label: UILabel!
  
  
  @IBAction func guessButton(sender: AnyObject) {
  
  
  
  
      var randomnumber = arc4random_uniform(6)
  
  
      var guessInt = guess.text!.toInt()
  
  
      if guessInt != nil {
  
  
          if Int(randomnumber) == guessInt {
  
              label.text = "correct"
  
  
          } else {
  
              label.text = "nope it wsa \(randomnumber)"
  
          }
  
  
  
  
  
      } else {
  
  
          label.text = "enter a number"
  
  
      }
  
  
      print(guess.text)
  
  
  
  
  
  
  
  
  }
  override func viewDidLoad() {
      super.viewDidLoad()
      // Do any additional setup after loading the view, typically from a nib.
  }
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  }
  </code></pre>
  
  <p>}</p>