Search code examples
ios6icloud

Is this ALAssetsGroup on iCloud?


I was trying to figure out if the ALAssetsGroup I had a pointer to was hosted on/copied to iCloud. Not finding the question already asked, I was able to figure it out.

Use valueForProperty on the group object with ALAssetsGroupPropertyType. This returns an NSNumber which is a bitmask of several flags include ALAssetsGroupPhotoStream.


Solution

  • - (BOOL) isICloudAlbum:(ALAssetsGroup*)group {
        NSNumber *groupType = [group valueForProperty:ALAssetsGroupPropertyType];
    
        return ([groupType intValue] & ALAssetsGroupPhotoStream) ? YES : NO;
    }