I'm trying to convert my svg
image data to UIImage
instance using SVGKit
, but when I'm trying to do this its getting crashed, and the error message is like below:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Asked to convert a Percentage value to a different type (5)'
Here is the code for svg
to UIImage
conversion.
if let data = response.data {
if let image = SVGKImage(data: data) {
if let uiImageInstance = image.uiImage {
self.userImageView.image = uiImageInstance
}
}
}
Its getting crashed at this line
-> if let uiImageInstance = image.uiImage {
I'm using AlamofireImage
library for downloading my image data from server.
I have checked that my svg
data is there in response.
FYI: My image is combination of avatar letters and gradient background.
See below image for reference.
My svg image sample URL: Link
Any help?
Thanks in advance.