2016-09-26 57 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

相關問題