title: Difference between two if statements + and else, and one if statement, one else if and one else?
body: <p>I'm using these statements to set progress on a progress bar, depending on the <code>seconds</code> variable. The function below is called every 1 second by a Timer object. After 7 seconds, the <code>refreshApp()</code> function is called.</p>
  
  <pre><code>func runTimedCode() {
  
      if seconds == 0 {
          self.progressView.setProgress(Float(self.seconds)/Float(7), animated: false)
          refreshApp()
          seconds += 1
      }
      else if seconds == 7 {
          self.progressView.setProgress(Float(self.seconds)/Float(7), animated: false)
          seconds = 0
      } else {
          self.progressView.setProgress(Float(self.seconds)/Float(7), animated: false)
          seconds += 1
      }
  }
  </code></pre>
  
  <p>It works as it should, but when I make the second statement an <code>if seconds == 7 {</code> , instead of <code>else if seconds == 7</code>, the progress bar seems to start not from a completely empty position (jumps from completely filled at 7 seconds, to a bit filled at 1 second). </p>
  
  <p>Could anyone help me understand why the behaviour changes? Thank you!</p>