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

3.4k Views Asked by At

I am using Kingfisher library for downloading an image from URL and setting to UIIMageView in Swift 4 project.

I know there are API changes between Kingfisher 2 and Kingfisher 3

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. It gives error

enter image description here

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?

Note: I have manually added Kingfisher library in the project. Not by pod or other package managers.

3

There are 3 best solutions below

0
On

This simple line work for me , although we normally don't need to import it

import Kingfisher
0
On

Build Settings>> Search Paths >>Framework Search Path>>Change path to ./ (selecting recursive.)

enter image description here

1
On

Use this pod:

pod 'Kingfisher'

Update Your Pod:

pod update

Import this library in your class file:

import Kingfisher