Why am I not able to use jpegData(compressionQuality:) and pngData() instance methods of the UIImage class like the documentation says I can.
I'm looking at the documentation for UIImage under Instance Methods at Apple's website.
Then the documentaton is for Xcode 10 beta 3.
func jpegData(compressionQuality: CGFloat) -> Data?
You can find a sign showing "API changes Show" at the top-right of the page. When you click it you can see how it has changed since Xcode 9.4.
You need to use the global function (not an insance method) `
UIImageJPEGRepresentation(_:_:)` or `UIImagePNGRepresentation(_:)`, in Xcode 9.4.1.