2016-09-26 58 views
1

我的项目是用Xcode 7开发的,昨天我用Xcode 8更新了它,并用最新的swift swift 3.0转换swift编码。现在它给了我一些地方的错误,我已经解决了所有问题,但没有得到用于模糊使用sd_setImage(with: ,placeholderImage: ,completed)行的ID。任何人都可以帮我解决这个问题吗?我正在使用SDWebimage库在我的应用程序中加载图像。SDWebImage Library获取swift错误3 Xcode 8.0

enter image description here

感谢

已经检查这个环节,但没有得到该怎么办。 Ambiguous use of 'sd_setImage(with:placeholderImage:completed:)' with Swift 3

+2

可能的复制[不明确使用 'SD \ _setImage(附:placeholderImage:完成:)' 与斯威夫特3] (http://stackoverflow.com/questions/38949214/ambiguous-use-of-sd-setimagewithplaceholderimagecompleted-with-swift-3) –

+0

我已检查,但没有得到正是我需要做的,所以你可以解释我的事情换一种说法? – user3418619

回答

3

Swift 3有一种解释Obj-C头文件的新方法,好像现在有2个差异类的碰撞方法签名。

临时修正可能是使用url:placeholderImage:options:completed variant。

view.sd_setImage(with: photoURL, placeholderImage: placeHolderImage, 
options: [.continueInBackground, .lowPriority]) { (image, error, cacheType, url) in 
    ... 
    } 
0

嘿我们可以用这样的

YOURIMAGEVIEW.sd_setImage(with: URL(string: IMAGEURL), 
placeholderImage: UIImage(named:"PLACEHOLDER"), options: [], completed: { 
(image, error, cache, url) in 
    DispatchQueue.main.async { 
     YOURIMAGEVIEW.image = image 
    } 
}) 

从该https://stackoverflow.com/a/39024894/4720374

相关问题