title: UIImagePNGRepresentation() has been replaced by .pngdata()
body: <p>In Xcode 10 <code>UIImagePNGRepresention()</code> worked ,but in the new Xcode it changed to .pngData() . And I'm not sure how to use the new instance method properly.</p>
  
  <p>I'm trying to convert a <code>UIImage</code> to <code>NSData</code> and not sure how to do that on <code>.pngData()</code>
  This is how I did it on the old <code>UIImagePNGRepresentation()</code>:</p>
  
  <pre><code>let imageData:NSData = UIImagePNGRepresentation(image!)! as NSData
  </code></pre>
  
  <p>I want to know how to do that ^ in the new intance method</p>