确保筛选有数据

This commit is contained in:
bluesea 2024-03-25 14:45:38 +08:00
parent 591784a9ec
commit 7b4428e416
2 changed files with 5 additions and 0 deletions

View File

@ -337,6 +337,7 @@ class CCSpaceAlbumFilterPopView2: UIView {
}
func loadMoreData(offset:Int) {
let fetchResult_collection = PHAssetCollection.fetchAssetCollections(with: PHAssetCollectionType.smartAlbum, subtype: PHAssetCollectionSubtype.any, options: nil);
//
var spatialAC:PHAssetCollection?
@ -359,6 +360,10 @@ class CCSpaceAlbumFilterPopView2: UIView {
fetchOptions.predicate = predicate
}
let fetchResult_asset = PHAsset.fetchAssets(in: sac, options: fetchOptions)
guard offset < fetchResult_asset.count else {//
return
}
var count = 0
for i in offset ..< fetchResult_asset.count {
let asset = fetchResult_asset.object(at: i)