Reputation: 235
My Project was Developed with Xcode 7, Yesterday I have updated it with Xcode 8 and convert swift coding with latest swift version swift 3.0. Now it gives me error on some place all most I have solved all but not getting ID for ambiguous use of sd_setImage(with: ,placeholderImage: ,completed)
line. can any one help me to solve this? I am using SDWebimage
Library to load image in my application.
Thanks
Already checked this link but not getting what to do. Ambiguous use of 'sd_setImage(with:placeholderImage:completed:)' with Swift 3
Upvotes: 1
Views: 2273
Reputation: 726
Hey i think this will resolve your problem
YOURIMAGEVIEW.sd_setImage(with: URL(string: IMAGEURL),
placeholderImage: UIImage(named:"PLACEHOLDER"), options: [], completed: {
(image, error, cache, url) in
DispatchQueue.main.async {
YOURIMAGEVIEW.image = image
}
})
from that https://stackoverflow.com/a/39024894/4720374
Upvotes: 0
Reputation: 1552
Swift 3 has a new way of interpreting Obj-C headers, seems like there are now 2 method signatures from 2 diff classes colliding.
A temporary fix could be using the url:placeholderImage:options:completed variant.
view.sd_setImage(with: photoURL, placeholderImage: placeHolderImage,
options: [.continueInBackground, .lowPriority]) { (image, error, cacheType, url) in
...
}
Upvotes: 3