UIImageJPEGRepresentation not available in swift 5 || Image to data conversion in swift

Solution:

In swift 4 we can use the below code to convert the image to data

Swift 4:

 UIImageJPEGRepresentation(savingImage, 0.5)

swift 5:

savingImage.jpegData(compressionQuality: 0.5)

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift