由于SDWebImage是第三方庫(kù),為了滿(mǎn)足公司項(xiàng)目開(kāi)發(fā)的需要,接口用起來(lái)更簡(jiǎn)單,且統(tǒng)一處理異常,故對(duì)接口進(jìn)行統(tǒng)一修改。
before:
[cell.imageIcon sd_setImageWithURL:[NSURL URLWithString:([LCStringUtil isBlankString:item.headPortrait]?@"":item.headPortrait)]
placeholderImage:[UIImage imageNamed:@"man_default.png"]];
after:
[cell.imageIcon imageWithUrlString:item.headPortrait
placeholderImage:@"man_default.png"];
before:
[cell.imageView sd_setImageWithURL:[NSURL URLWithString:subItem.imagePath]];
after:
[cell.imageView imageWithUrlString:subItem.imagePath];
URL直接傳遞NSString類(lèi)型,placehloderImage可以是NSString類(lèi)型,也可以是UIImage類(lèi)型。
更多接口請(qǐng)看項(xiàng)目文件。