2

Trying to resize an image to a thumbnail using the following code, getting error:

Use of unresolved identifier

for kCGInterpolationHigh

@IBAction func dropPhoto(sender: AnyObject) {
    presentViewController(imagePicker, animated: true, completion: nil)
}
func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage, editingInfo: [String : AnyObject]?) {
    self.dismissViewControllerAnimated(true, completion: nil)

    let thumbnail = image.resizedImageWithContentMode(UIViewContentMode.ScaleAspectFit, bounds: CGSizeMake(400, 400), interpolationQuality: kCGInterpolationHigh)
    let imgData = UIImagePNGRepresentation(thumbnail)

}
}
Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Coe
  • 21
  • 1

1 Answers1

3

Use CGInterpolationQuality.High instead of kCGInterpolationHigh in iOS 9+.

Reference: https://developer.apple.com/library/prerelease/ios/documentation/GraphicsImaging/Reference/CGContext/index.html#//apple_ref/c/tdef/CGInterpolationQuality

Eric Aya
  • 69,473
  • 35
  • 181
  • 253