1

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.

enter image description here

Thanks

Already checked this link but not getting what to do. Ambiguous use of 'sd_setImage(with:placeholderImage:completed:)' with Swift 3

Community
  • 1
  • 1
user3418619
  • 235
  • 1
  • 2
  • 14
  • 2
    Possible duplicate of [Ambiguous use of 'sd\_setImage(with:placeholderImage:completed:)' with Swift 3](http://stackoverflow.com/questions/38949214/ambiguous-use-of-sd-setimagewithplaceholderimagecompleted-with-swift-3) – Anton Malyshev Sep 26 '16 at 07:58
  • I have checked that but not getting exactly what I need to do so can you explain me that things in other words? – user3418619 Sep 26 '16 at 09:36

2 Answers2

3

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
     ...
    }
Joris Timmerman
  • 1,482
  • 14
  • 25
0

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