简体   繁体   中英

SDWebImage Library getting error with swift 3 Xcode 8.0

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

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
     ...
    }

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM