UIImageJPEGRepresentation has been replaced by instance method UIImage.jpegData(compressionQuality:)
//4.0 if let jpegData = UIImageJPEGRepresentation(newImage, 80) { try? jpegData.write(to: imagePath) }
//4.2 if let jpegData = newImage.jpegData(compressionQuality: 80) { try? jpegData.write(to: imagePath) }
If this helped you, share and pass it on! 😀 ➡️ 🐦