Until today, I was used to have all my svg files into my assets' folder inside my project
So far so good, a simple Image("example") works great
Today, we decided to make an API request to download these SVG files
I succeed to write the file on disk, fine Data from local URL seems to work too but then, UIImage from Data doesn't work
let logo = logoFolder.appendingPathComponent("example.svg")
if fileManager.fileExists(atPath: logo.path) {
do {
let data = try Data(contentsOf: logo)
if let uiImage = UIImage(data: data) {
//The conversion above doesn't work
completionHandler(.success(Image(uiImage: uiImage)))
return
}
} catch {}
completionHandler(.failure(.fetchingFailed))
}
FYI, the same code works very well to get mp3 or png files