【发布时间】:2015-08-26 12:55:18
【问题描述】:
有什么方法可以保留用户在“照片”应用中排列所有相册的列表顺序?我整天都在尝试解决这个问题,但我似乎无法弄清楚我缺少什么来保留在我的应用程序中显示的顺序。
我想保留顺序,因为用户可以在照片应用中重新排列他们的相册,所以我希望我的 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
}
}
【问题讨论】:
标签: ios objective-c photokit photosframework