title: Swift: Cannot assign a value of type 'int' to a value of type 'int?' Error
body: <p>I'm starting to learn swift, but ran into an error. Ive just created a very simple app from a course I'm following, that calculates a cats ages based on what the user enters. The first version of the app just times what the user enters by 7, which i managed todo no problem. I thought I would have a play with what I've written and change it todo this:</p>
  
  <ul>
  <li>1st human year = 15 cat years</li>
  <li>2nd human year = +10</li>
  <li>3rd human year = +4</li>
  <li>4th human year = +4</li>
  <li>5th human year = +4</li>
  </ul>
  
  <p>so on..</p>
  
  <p>e.g. a 4 year old cat would be 33 in cat years.</p>
  
  <p>So I want my results label to say You're cat is 33 in cat years</p>
  
  <p>This is the code I've written:</p>
  
  <pre><code>    @IBAction func findAge(sender: AnyObject) {
  
      var enteredAge = enterAge.text.toInt()
  
      if enteredAge = 1 {
  
          var catYears = 15
  
          resultLabel.text = "You're cat is \(catYears) in cat years"
  
      } else if enteredAge = 2 {
  
          var catYears = 25
  
          resultLabel.text = "You're cat is \(catYears) in cat years"
  
      } else {
  
          var catYears = (15 + 25) + (enteredAge - 2) * 4
  
          resultLabel.text = "You're cat is \(catYears) in cat years"
  
      }
  
  }
  
  @IBOutlet weak var enterAge: UITextField!
  
  
  @IBOutlet weak var resultLabel: UILabel!
  </code></pre>
  
  <p>This error I'm getting is on the line 17 "if enteredAge = 1 {" it states this "cannot assign a value of type 'int' to a value of type 'int?'"</p>
  
  <p>I don't really understand why this value cannot be a integer, any help would be great.</p>