I am using the following method to save the PNG image to UserDefaults
:
func convertImageToBase64String (img: UIImage) -> String {
return img.pngData()?.base64EncodedString() ?? ""
}
The issues are that this data is using significantly Documents & Data storage:
And for some reason even if this data is removed from UserDefaults
, this amount do not change.
I would like to fix this issues, but need to use PNG images as transparent background is important.