简体   繁体   English

“UIImageView”类型的值在swift 4中没有成员“kf”

[英]Value of type 'UIImageView' has no member 'kf' in swift 4

I am using Kingfisher library for downloading an image from URL and setting to UIIMageView in Swift 4 project.我正在使用 Kingfisher 库从 URL 下载图像并在 Swift 4 项目中设置为 UIIMageView。

I know there are API changes between Kingfisher 2 and Kingfisher 3我知道 Kingfisher 2 和 Kingfisher 3 之间存在 API 更改

https://github.com/onevcat/Kingfisher/wiki/Kingfisher-3.0-Migration-Guide https://github.com/onevcat/Kingfisher/wiki/Kingfisher-3.0-Migration-Guide

My project was working a few weeks back but after upgrading Xcode, cannot compile the project.我的项目几周前还在工作,但在升级 Xcode 后,无法编译该项目。 It gives error它给出了错误

在此处输入图片说明

I have tried deleting derived data and all possible solutions from the links I have got it from google.我尝试从我从谷歌获得的链接中删除派生数据和所有可能的解决方案。

Anyone facing the same issue with Kingfisher library?任何人都面临与 Kingfisher 库相同的问题?

Note: I have manually added Kingfisher library in the project.注意:我已经在项目中手动添加了 Kingfisher 库。 Not by pod or other package managers.不是 pod 或其他包管理器。

Use this pod:使用这个吊舱:

pod 'Kingfisher'

Update Your Pod:更新您的 Pod:

pod update

Import this library in your class file:在你的类文件中导入这个库:

import Kingfisher

这个简单的行对我有用,虽然我们通常不需要导入它

import Kingfisher

Build Settings>> Search Paths >>Framework Search Path>>Change path to ./ (selecting recursive.)构建设置>>搜索路径>>框架搜索路径>>将路径更改为./(选择递归。)

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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