Home / IOS Development / How do I test PHImageResultIsInCloudKey?

How do I test PHImageResultIsInCloudKey?

My app has a custom photo selector that uses the Pictures framework to browse albums and select an image. I have isolated reports of a very specific error that occurs only if the user (a) has iCloud Photo Library turned on, (b) has Optimize storage turned on in their Images settings and (c) the particular album and / or image has been moved by the unit.

In this scenario, it seems that no actual image is returned to the shutter I send to PHCachingImageManager # requestImage . Instead, from what I collect, PHImageResultIsInCloudKey is included in the info dictionary, and I must again urge the request with isNetworkAccessAllowed set to true.

But in my own testing, I just can't get this specific scenario to happen, so I can confirm that my repair is working. Even with iCloud Photo Library on and optimizing storage on, I still always get a picture and never get PHImageResultIsInCloudKey .

Is there a way to force a situation where the image is without unity and must be loaded from the cloud?

Source link