title: How do I resize the UIImage to reduce upload image size
body: <p>I've been searching google, and have only come across libraries that either reduce the height/width or some how edit the UIImage appearance via CoreImage. But I have not seen or found one library, post that explains how to reduce image size so when it uploads, it's not the full image size.</p>
  
  <p>so far I have this: </p>
  
  <pre><code>        if image != nil {
          //let data = NSData(data: UIImagePNGRepresentation(image))
          let data = UIImagePNGRepresentation(image)
          body.appendString("--\(boundary)\r\n")
          body.appendString("Content-Disposition: form-data; name=\"image\"; filename=\"randomName\"\r\n")
          body.appendString("Content-Type: image/png\r\n\r\n")
          body.appendData(data)
          body.appendString("\r\n")
      }
  </code></pre>
  
  <p>and it's sending 12MB photos. How can I reduce this to 1mb? thanks!</p>