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:
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
Post a Comment