UIImage
-
Returns the data for the image in a decently-sized JPEG format.
Declaration
Swift
public func dataForUpload(targetWidth: CGFloat = 1125.0, jpegCompressionQuality: CGFloat = 0.6) -> Data?Parameters
targetWidththe target width of the image, defaults to 1125.0 ie the largest width displayable on an iPhone (iPhone X).
jpegCompressionQualitythe JPEG compression quality, defaults to 0.6 after benchmarking results
Return Value
the data to upload for the image.
View on GitHub
UIImage Extension Reference