4

I am accessing the user's photos for uploading from PHPhotoLibrary, but I need to be able to tell if they have iCloud Photo Library turned on or not.

If they have iCloud Photo Library, then they will have a photo album titled 'All Photos' - which they won't have if iCloud Photo Library is turned off.

William GP
  • 1,252
  • 1
  • 14
  • 29

2 Answers2

7

I don't think there's any straight-forward way to do this. However, there are two workarounds that I am familiar with:

  1. Check the localizedTitle of assetCollection with subType of PHAssetCollectionSubtypeSmartAlbumUserLibrary. The localizedTitle will be "Camera Roll" for iCloud disabled devices, and "All Photos" for iCloud enabled devices. Keep in mind that if Apple changes the name in the future, it would break.

  2. Each PHAsset object has a sourceType. For iCloud photos, the value would be PHAssetSourceTypeCloudShared. The bad thing about this method is that if the user does not have photos on iCloud at the moment, you won't be able to say that it does have iCloud Photo Library disabled.

Aviram
  • 3,017
  • 4
  • 29
  • 43
0

Not a direct answer to the question, but a similar query would be determining whether each picture is in iCloud or on the device. In which case bcattle's answer here should do the trick:

Community
  • 1
  • 1
William GP
  • 1,252
  • 1
  • 14
  • 29