title: How do I convert a UITextField to an integer in Swift 2.0?
body: <p>I'm a beginner at swift, and was doing some testing. To tell you the truth, I barely know what I'm doing yet, so please try to explain clearly. I was making a random number generator app &amp; wanted to add in a <code>uitextfield</code> so that the user can type in their guess of the next randomly generated number. I keep getting an error when trying to use the if statement to compare the randomly generated number to the number entered In the text field. </p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController, UITextFieldDelegate {
      @IBOutlet weak var input: UITextField! 
      @IBOutlet weak var infoLabel: UILabel! // Displayed Before The User Clicks Button For The First Time.
      @IBOutlet weak var numberLabel: UILabel!
      @IBAction func go(sender: AnyObject) {
          // Remove The Text Under The Button 
          infoLabel.text = " "
  
          // Generate Random Number 
          let randomNumber = Int(arc4random_uniform(11))
  
          // Change The "Number Label's" Text In Order To Show The Randomly Generated Number To The User        
          numberLabel.text = "\(randomNumber)"
  
          // Check To See If The User Guessed The Correct Number, And If They Did, Tell Them They Were Right
          if input == randomNumber {
              infoLabel.text = "Your Guess,\(randomNumber) Was Correct!"
          }
      }
  
      override func viewDidLoad() {
          super.viewDidLoad()
      }
  }
  </code></pre>