I am trying to implement Kingfisher to handle my images because I am doing them manually at the moment and it's not good. I seem to be having some issues though.
I downloaded this pod via CocoaPods:
pod 'Kingfisher', '~> 7.0'
And I changed this code:
import Kingfisher
if let dataDecoded: NSData = NSData(base64Encoded: businessData.business_logo ?? "", options: NSData.Base64DecodingOptions(rawValue: 0)) {
if let decodedimage: UIImage = UIImage(data: dataDecoded as Data) {
Image(uiImage: decodedimage)
.resizable()
}
}
To this code:
import Kingfisher
if let url = URL(string: businessData.business_logo ?? "") {
KFImage(url)
.resizable()
}
When I run the code, this is printed to the console:
2023-05-08 17:58:33.751513+0100 Project Name[23531:243997] Task <1F4ADD8F-C550-460C-87B3-307E9BDFFD20>.<1> finished with error [-1002] Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSLocalizedDescription=unsupported URL,
Any ideas on why this is happening? Is there a SwiftUI version of the pod I need?