title: How to identify if a PHAsset is not completely downloaded from iCloud (so I need to request again with options.networkAccessAllowed)
body: <p>The docs say:</p>
  
  <blockquote>
    <p>PHImageResultIsInCloudKey:
    A Boolean value indicating whether the photo asset data is stored on the local device or must be downloaded from iCloud. (NSNumber)
    If YES, no image was provided, because the asset data must be downloaded from iCloud. To download the data, submit another request, and specify YES for the networkAccessAllowed option.</p>
  </blockquote>
  
  <p>But this key is always YES when a asset is stored in the iCloud Photo Library, even when it is already completely downloaded to the device (downloaded it in my app, also opened it in the Photos app).</p>
  
  <p>If an image is not available I want to give the user a possibility to download it (but don't do it automatically, at least not when no Wifi is around).</p>
  
  <p>So how do I find out if the image needs to be downloaded?</p>
  
  <p>Even more curious: When my result block of
  <code>requestImageForAsset:targetSize:contentMode:options:resultHandler:</code>
  is called for an image that needs to be downloaded, I get a last call with requestedImage == nil, after a smaller and degraded version was delivered.</p>
  
  <p>In this case degraded is NO, even that I got no image and the image still has to be downloaded from iCloud as only a small thumbnail from the Photos app is locally available so far.</p>
  
  <p>I tested this on iPhones and iPads with different iOS 8 versions (8.1.x, 8.2 beta, 8.3 beta) the behavior is always the same.</p>
  
  <p>Once I opened the image in the Photos app, the last call of the result handler has the full size image, but PHImageResultIsInCloudKey will still be YES.</p>
  
  <p>Here's some code how I request the images:</p>
  
  <pre><code>PHImageRequestOptions *options = [[PHImageRequestOptions alloc]init];
  options.deliveryMode = PHImageRequestOptionsDeliveryModeOpportunistic;
  options.networkAccessAllowed = NO;
  
  [self.imageManager requestImageForAsset:asset targetSize:size contentMode:PHImageContentModeAspectFill options:options resultHandler:^(UIImage *requestedImage, NSDictionary *info) {
      // Checking for requestedImage and the info keys here
      // When a full sized image was loaded, the result of PHImageResultIsInCloudKey is still YES
      // When a full sized image couldn't be loaded cause it's in the cloud, isDegraded is NO and PHImageResultIsInCloudKey is YES (as always) and requestedImage is nil
  }];
  </code></pre>