简体   繁体   中英

Value of type 'UIImageView' has no member 'kf_setImage'

I am trying to execute my code but I am getting the error

Value of type 'UIImageView' had no member 'kf_setImage'

Xcode 截图

The line

self.imgProjectImage.kf_setImage(with: url)

should be

self.imgProjectImage.kf.setImage(with: url)

in Kingfisher 2.0 ,you should:

imageView.kf_setImageWithURL(URL, 
      placeholderImage: nil,
           optionsInfo: optionInfo,
         progressBlock: { receivedSize, totalSize in
         },
     completionHandler: { image, error, cacheType, imageURL in
     })

In Kingfisher 3.0 ,you should:

let url = URL(string: "url_of_your_image")
imageView.kf.setImage(with: url)

please,make sure you use Kingfisher version

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