I've been trying to show the progressHUD when my cell loads, and it should show how the download progress are doing. so i placed the code in SDWebimage progress block to get the download progress and pass it into MBProgress HUD to work but i don't know what i am doing wrong here !
let url = NSURL(string: (array[indexPath.row][0] as? String)!)
cell.imageView.sd_setImageWithURL(url, placeholderImage: nil, options: nil, progress: { (value1, value2) -> Void in
self.HUD = MBProgressHUD(view: self.mycollectionView)
self.view.addSubview(self.HUD)
self.HUD.mode = MBProgressHUDMode.AnnularDeterminate
self.HUD.delegate = self
self.HUD.show(true)
var x : Float = Float(value1)
self.HUD.progress = x
println(value1)
println(value2)
}, completed: block)
I am getting also an error saying : 'MBProgressHUD needs to be accessed on the main thread.'