我正在尝试获取PhAsset对象.我想隔离iCloud资产.这是我的代码,
PHFetchResult *cloudAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAny options:nil];
[cloudAlbums enumerateObjectsUsingBlock:^(PHAssetCollection *collection, NSUInteger idx, BOOL *stop){
if(collection != nil){
PHFetchResult *result = [PHAsset fetchAssetsInAssetCollection:collection options:fetchOptions];
[result enumerateObjectsUsingBlock:^(PHAsset *asset, NSUInteger idx, BOOL *stop)
{
// check asset is iCloud asset
}];
}
}];
Run Code Online (Sandbox Code Playgroud)
请告诉我如何找到PHAsset是iCloud资产?
我正在访问用户的照片以便从PHPhotoLibrary上传,但我需要能够判断他们是否打开了iCloud Photo Library.
如果他们有iCloud照片库,那么他们将会有一张名为"所有照片"的相册 - 如果关闭iCloud Photo Library,他们就不会拥有这些照片.