Thanks for considering to open an issue. Before you submit your issue, please confirm these boxes are checked.
[Tell us about the issue]
[The steps to reproduce this issue. What is the url you were trying to load, where did you put your code, etc.]
[Add anything else here]
SVG is not built-in supported in Kingfisher. You need to create your own processor and maybe use some other package (like this) to convert data and show it as an UIImage or NSImage.
This is how I used. I have created SVG Image Processor and for data parsing I have used SVGKit.
import UIKit
import Kingfisher
import SVGKit
public struct SVGImgProcessor:ImageProcessor {
public var identifier: String = "com.appidentifier.webpprocessor"
public func process(item: ImageProcessItem, options: KingfisherParsedOptionsInfo) -> KFCrossPlatformImage? {
switch item {
case .image(let image):
print("already an image")
return image
case .data(let data):
let imsvg = SVGKImage(data: data)
return imsvg?.uiImage
}
}
}
Use SVGImgProcessor like this:
imageView.kf.setImage(with: imURL, options: [.processor(SVGImgProcessor())])
AppDelegate.isForWorker
what is that? what should I do with this
Use SVGImgProcessor like this:
imageView.kf.setImage(with: imURL, options: [.processor(SVGImgProcessor())])
Most helpful comment
This is how I used. I have created SVG Image Processor and for data parsing I have used SVGKit.