Does PHImageManager return images in pixel or point size for 2x and 3x screens?
According to my experiments with PHImageManager
you must provide a targetSize
in pixels. For example, imagine you wanna request an image with the size 400x800 px. For this case you can set the target size like the following:
// Set target size. let targetSize = CGSizeMake(400, 800)
Regarding your code example, in the Apple's docs stated that:
The coordinates of the frame rectangle are always specified in points.
So to set the correct target size in this case you can use code similar to the following:
// Get scale factor associated with the screen. let scale = UIScreen.mainScreen().scale// Request the image.imageManager.requestImageForAsset(self.imageAsset, targetSize: CGSizeMake(self.frame.size.width * scale, self.frame.size.height * scale), contentMode: .AspectFit, options: imageRequestOptions, resultHandler: { (image, info) -> Void in // Handle the result here... })