Commit 7fa5ea76 authored by yuzheng.tz's avatar yuzheng.tz

使用ALAssetsGroupPropertyType的值来判断是否是我的照片流相册

parent 5d7862f7
...@@ -191,9 +191,8 @@ static dispatch_once_t onceToken; ...@@ -191,9 +191,8 @@ static dispatch_once_t onceToken;
} }
} }
// 判断相册类型建议不要使用字符串判断,不然只能在中文和英文环境下能用了 if (collection.assetCollectionSubtype == PHAssetCollectionSubtypeSmartAlbumAllHidden) continue;
if (collection.assetCollectionSubtype == PHAssetCollectionSubtypeSmartAlbumAllHidden) continue; // 『已隐藏』相册 if (collection.assetCollectionSubtype == 1000000201) continue; //『最近删除』相册
if (collection.assetCollectionSubtype == 1000000201) continue; // 『最近删除』相册
if ([self isCameraRollAlbum:collection]) { if ([self isCameraRollAlbum:collection]) {
[albumArr insertObject:[self modelWithResult:fetchResult name:collection.localizedTitle isCameraRoll:YES needFetchAssets:needFetchAssets] atIndex:0]; [albumArr insertObject:[self modelWithResult:fetchResult name:collection.localizedTitle isCameraRoll:YES needFetchAssets:needFetchAssets] atIndex:0];
} else { } else {
...@@ -218,11 +217,7 @@ static dispatch_once_t onceToken; ...@@ -218,11 +217,7 @@ static dispatch_once_t onceToken;
if ([self isCameraRollAlbum:group]) { if ([self isCameraRollAlbum:group]) {
[albumArr insertObject:[self modelWithResult:group name:name isCameraRoll:YES needFetchAssets:needFetchAssets] atIndex:0]; [albumArr insertObject:[self modelWithResult:group name:name isCameraRoll:YES needFetchAssets:needFetchAssets] atIndex:0];
} else if ([name isEqualToString:@"My Photo Stream"] || [name isEqualToString:@"我的照片流"]) { } else if ([[group valueForProperty:ALAssetsGroupPropertyType] intValue] == ALAssetsGroupPhotoStream) {
// 这里也不建议使用字符串判断,
// 貌似应该使用 [group valueForProperty:ALAssetsGroupPropertyType] == *特定值*
// 具体的值我并不知道,因为已经找不到iOS8.0以下的手机或模拟器来调试了
if (albumArr.count) { if (albumArr.count) {
[albumArr insertObject:[self modelWithResult:group name:name isCameraRoll:NO needFetchAssets:needFetchAssets] atIndex:1]; [albumArr insertObject:[self modelWithResult:group name:name isCameraRoll:NO needFetchAssets:needFetchAssets] atIndex:1];
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment