有没有办法保留用户在照片应用中排列所有相册的列表顺序?我一直在努力解决这个问题,而且我似乎无法弄清楚我缺少什么来保留在我的应用程序中显示的顺序.
我想保留订单,因为用户可以在照片应用中重新排列他们的相册,所以我希望我的UI与列表顺序相匹配.
代码我用来设置列表:
PHFetchResult *smartAlbumFetchResult = [PHAssetCollection fetchAssetCollectionsWithType: PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeAny options:nil]; PHFetchResult *albumFetchResult = [PHAssetCollection fetchAssetCollectionsWithType: PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAny options:nil]; NSArray *collectionFetches = @[smartAlbumFetchResult,albumFetchResult]; NSMutableArray *albumArray = [NSMutableArray new]; for (PHFetchResult *newFetch in collectionFetches) { for (PHAssetCollection *sub in newFetch) { [albumArray addObject:sub]; // Other setup omitted } }@H_301_8@