title: linking UIProgressView to show download progress using Firebase
body: <p>i am trying to show progress view of the file that i am download when i printed the progress it is right but when i implement it on the progress view it is completely wrong it goes to 3000% here is my code. i am using MHRadialProgressView</p>
  
  <pre><code>downloadTask.observe(.progress) { (snapshot) -&gt; Void in
      // Download reported progress
  
      let percentComplete = 100 * Double(snapshot.progress!.completedUnitCount) / Double(snapshot.progress!.totalUnitCount)
      print("percentComplete")
      self.progressView.moveNext(currentprogress as NSNumber!)
  
      // Update the progress indicator
  }
  </code></pre>
  
  <p>when i used MBProgressHUD here is the code for it </p>
  
  <pre><code>  downloadTask.observe(.progress) { (snapshot) -&gt; Void in
                  // Download reported progress    
                  let percentComplete = 100 * Float(snapshot.progress!.completedUnitCount)
                      / Float(snapshot.progress!.totalUnitCount)
  
              let hud = MBProgressHUD.showAdded(to: (self.navigationController?.view)!, animated: true)
              // Set the determinate mode to show task progress.
              hud.mode = MBProgressHUDMode.determinate
  
              hud.label.text = NSLocalizedString("Loading...", comment: "HUD loading title")
              // Set up NSProgress
              let progressObject = Progress(totalUnitCount: 100)
              hud.progressObject = progressObject
              // Configure a cancel button.
  
  
              DispatchQueue.global(qos: .default).async(execute: {() -&gt; Void in
                  // Do something useful in the background and update the HUD periodically.
  
                  while progressObject.fractionCompleted &lt; 1.0 {
  
                      progressObject.becomeCurrent(withPendingUnitCount: 1)
                      progressObject.resignCurrent()
                      usleep(useconds_t(percentComplete))
                  }
  
                  DispatchQueue.main.async(execute: {() -&gt; Void in
                      hud.hide(animated: true)
                  })
              })
          }
  </code></pre>
  
  <p>i am getting this error 
  nanfatal error: Float value cannot be converted to UInt32 because it is either infinite or NaN</p>