title: Swift - Creating a progress bar
body: <p>Hi I am using this code to try and animate a progress bar based on time.</p>
  
  <pre><code>  import UIKit
  
  class LoadingScreen: UIViewController {
  
      @IBOutlet var progressView: UIProgressView!
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
  
  
          var time = 0.0
          var timer: NSTimer
  
          timer = NSTimer.scheduledTimerWithTimeInterval(0.1, target: self, selector:Selector("setProgress"), userInfo: nil, repeats: true)
  
          func setProgress() {
              time += 0.1
                  progressView.progress = time / 3
              if time &gt;= 3 {
                  timer.invalidate()
              }
          }
  </code></pre>
  
  <p>However I get an error which says: cannot sign a value of type double to a value of type float.</p>
  
  <p>EDIT:</p>
  
  <p>The error is on this line:</p>
  
  <pre><code>progressView.progress = time / 3 
  </code></pre>