Reputation: 21
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)
}
}
Upvotes: 2
Views: 990
Reputation: 70098
Use CGInterpolationQuality.High
instead of kCGInterpolationHigh
in iOS 9+.
Upvotes: 3