Commit 38e1472a authored by banchichen's avatar banchichen

修复两处小问题

parent 23d41f1e
......@@ -86,6 +86,8 @@ static CGFloat TZScreenScale;
option.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"modificationDate" ascending:self.sortAscendingByModificationDate]];
PHFetchResult *smartAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeAlbumRegular options:nil];
for (PHAssetCollection *collection in smartAlbums) {
// 有可能是PHCollectionList类的的对象,过滤掉
if (![collection isKindOfClass:[PHAssetCollection class]]) return;
if ([self isCameraRollAlbum:collection.localizedTitle]) {
PHFetchResult *fetchResult = [PHAsset fetchAssetsInAssetCollection:collection options:option];
model = [self modelWithResult:fetchResult name:collection.localizedTitle];
......@@ -122,6 +124,8 @@ static CGFloat TZScreenScale;
PHFetchResult *topLevelUserCollections = [PHCollectionList fetchTopLevelUserCollectionsWithOptions:nil];
for (PHAssetCollection *collection in smartAlbums) {
// 有可能是PHCollectionList类的的对象,过滤掉
if (![collection isKindOfClass:[PHAssetCollection class]]) return;
PHFetchResult *fetchResult = [PHAsset fetchAssetsInAssetCollection:collection options:option];
if (fetchResult.count < 1) continue;
if ([collection.localizedTitle containsString:@"Deleted"] || [collection.localizedTitle isEqualToString:@"最近删除"]) continue;
......@@ -132,6 +136,8 @@ static CGFloat TZScreenScale;
}
}
for (PHAssetCollection *collection in topLevelUserCollections) {
// 有可能是PHCollectionList类的的对象,过滤掉
if (![collection isKindOfClass:[PHAssetCollection class]]) return;
PHFetchResult *fetchResult = [PHAsset fetchAssetsInAssetCollection:collection options:option];
if (fetchResult.count < 1) continue;
[albumArr addObject:[self modelWithResult:fetchResult name:collection.localizedTitle]];
......
......@@ -148,7 +148,6 @@
self.allowPickingOriginalPhoto = self.allowPickingOriginalPhoto;
self.timeout = 15;
self.photoWidth = 828.0;
self.maxImagesCount = selectedAssets.count;
self.photoPreviewMaxWidth = 600;
self.barItemTextFont = [UIFont systemFontOfSize:15];
self.barItemTextColor = [UIColor whiteColor];
......
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