I'm having an issue with MBProgressHUD, I'm using it with SDWebImage. so actually as a function its working well.and what i do, is to the show progress and when its done show the image and hide the progress.
But sometimes the image shows and the progress is like 80 percent loading and then it hangs and never hides the progress,so i have to navigate back out of the controller to fix it.
HUD = MBProgressHUD(view: self.view)
self.view.addSubview(HUD)
HUD.mode = MBProgressHUDMode.AnnularDeterminate
HUD.delegate = self
HUD.show(true)
let block: SDWebImageCompletionBlock! = {(image: UIImage!, error: NSError!, cacheType: SDImageCacheType, imageURL: NSURL!) -> Void in
// println(self)
self.HUD.hide(false)
self.HUD.removeFromSuperViewOnHide = true
}
cell.imageView.sd_setImageWithURL(url, placeholderImage: nil, options: nil, progress: { (value1, value2) -> Void in
dispatch_async(dispatch_get_main_queue(), {
var progress = Float(value1)/Float(value2)
self.HUD.progress = progress
})
}, completed: block)