title: First Swift Calculator
body: <p>I'm learning Swift, and I decided that instead of always copying code from videos, I would try to build something myself.</p>
  <p>I tried to make a calculator in a Playground to see if I could figure things out, and I came up with this. Is this a good way to do it or does anyone have any feedback before I start the Xcode project?</p>
  <pre><code>var result: String = &quot;&quot;
  
  var plusClicked = false
  var equalsClicked = false
  
  var firstNumber: Int = 0
  var secondNumber: Int = 0
  
  func clickNumber(number: Int) {
      if equalsClicked == true {
          equalsClicked = false
          result = &quot;&quot; 
      }
      
      if plusClicked == true {    
          firstNumber = Int(result)!
          result = &quot;\(number)&quot;       
      } else {    
          result = result + &quot;\(number)&quot;  
      }
  }
  
  func clickPlus() {
      plusClicked = true
  }
  
  func clickEquals() {
      secondNumber = Int(result)!
      
      if plusClicked == true {
          result = &quot;\(firstNumber + secondNumber)&quot;
          plusClicked = false
      }
      
      equalsClicked = true
  }
  </code></pre>