Update UIProgressView in UICollectionViewCell for download file

痴心易碎 提交于 2019-12-01 22:22:42
LE SANG

Create your customCell and display all Visible UIViews in it(init , add subview...). Than use custom method in cellForItemAtIndexPath to active(display) it. If you think about MVC, cellForItemAtIndexPath just for Controller, not View.

In your case, bring all IBAction, loadLink and updateProgress to customCell and send parameter to active them, or you can create new protocol like CustomCellDelegate to communicate.

Check for more information:

Error setting text in collection view cell

It might be about the thread issue. just try

dispatch_async(dispatch_get_main_queue(), ^{
            UIProgressView *pgr = (UIProgressView *)[progress objectAtIndex:0];
            [pgr setProgress:[[progress objectAtIndex:1] floatValue]];
       });//end block

try async or sync

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!