title: Compress Image in iOS 12. How will this code be updated?
body: <pre><code>// compressing image(avaImg)before sending it to the server(Parse)
  
  let avaData = UIImageJPEGRepresentation(avaImg.image!, 0.5)
      let avaFile = PFFile(name: "ava.jpg", data: avaData!)
      user["ava"] = avaFile
  </code></pre>
  
  <p>When I replace it to the following line as recommended by the notifications I get the error below</p>
  
  <pre><code>let avaData = UIImage.jpegData(avaImg.image!, 0.5)
  </code></pre>
  
  <p><em>ERROR: Instance member 'jpegData' cannot be used on type 'UIImage'; did you mean to use a value of this type instead?</em>   </p>
  
  <p>I'm a newbie and I followed that on an online course so please baby steps!</p>