How to use WebP image in UIImageView Swift

david35 picture david35 · Aug 19, 2015 · Viewed 8.2k times · Source

I want to use webp image in UIImageView my ios project which is in Swift Language.

I tried using Matt Thompson library but it's not working with Swift project. I have imported the framework and did all required tasks but so many link errors.

How can I use webp Image in UIImageView in swift code?

Answer

auryn31 picture auryn31 · Jun 12, 2017

You can use the Pod https://github.com/rs/SDWebImage

There is it really easy to load WebP Images from the Web

With Swift:

SDWebImageManager.shared().loadImage(with: url, options: .highPriority, progress: nil, completed: {(resultSet) in
            YOURWEBVIEW.image = resultSet.0

        })