I have an image coming in as a JPEG. I need to assign the UIImageView with this data as a png. How can I convert the data to be a PNG by using
.pngData()
My transparent image is showing a white background because it comes in as a JPEG but I need it to come in as a PNG.
@IBOutlet weak var mainCenterIcon: UIImageView!
for item in metadataList {
guard let key = item.commonKey?.rawValue, let value = item.value else{
continue
}
switch key {
case "artwork" where value is Data :
mainCenterIcon.image? = UIImage(data: value as! Data)
default:
continue
}
}