I've been stuck with this for couple of days. I've bee trying to get the image within the call back but I always get nil
. These the options which I used:
let options = PHImageRequestOptions()
options.deliveryMode = .HighQualityFormat
options.resizeMode = .None
I also tried with options set to nil
without any luck. This is the data I got in the info value passed to the block.
[PHImageResultIsInCloudKey: 0,
PHImageResultDeliveredImageFormatKey: 9999,
PHImageFileURLKey: file:///var/mobile/Media/DCIM/100APPLE/IMG_0052.JPG,
PHImageResultRequestIDKey: 84,
PHImageResultIsDegradedKey: 0,
PHImageResultWantedImageFormatKey: 9999,
PHImageResultIsPlaceholderKey: 0,
PHImageFileSandboxExtensionTokenKey:
64b47b046511a340c57aa1e3e6e07994c1a13853;00000000;00000000;0000001a;com.apple.app-sandbox.read;;00000000;00000000;0000000000000000;/private/var/mobile/Media/DCIM/100APPLE/IMG_0051.JPG]
I also tried using requestImageForAsset
and I got the same result. I thought by using requestImageDataForAsset
I'll get more control on the data.
Also, I thought the file exists in the cloud, but it is not as PHImageResultIsInCloudKey
value is set 0
; otherwise, I'd download it.
by the way, I am able to get a smaller version of the image with predefined size of 200x200
inside another view; however, when I try to get the larger version of it, I get nil. I know that the image exists on the phone with higher res (I can see it in the Photos app)
Any help will be appreciated.
I had a similar issue and tried setting the networkAccessAllowed option on the PHImageRequestOptions object to YES - that seemed to fix it. For me the issue was definitely that the images were in the cloud as images on the camera roll worked fine but those in the cloud did not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With