1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// NSObject+AlbumItem.m
// gengmei_flutter_plugin
//
// Created by Apple on 2019/9/9.
//
#import "AlbumItem.h"
@implementation AlbumItem
-(void)setCollection:(PHAssetCollection *)collection {
_collection = collection;
// if ([collection.localizedTitle isEqualToString:@"All Photos"]||[collection.localizedTitle isEqualToString:@"所有照片"]) {
// self.collectionTitle = @"IsGengmeiAlbumAllImages";
// } else {
//
// }
self.collectionTitle = collection.localizedTitle;
// self.collectionTitle = collection.localizedTitle;
// 获得某个相簿中的所有PHAsset对象
self.assets = [PHAsset fetchAssetsInAssetCollection:collection options:nil];
if (self.assets.count > 0) {
self.firstAsset = self.assets[0];
}
self.collectionNumber = self.assets.count;
}
#pragma mark - Get方法
-(NSMutableArray<NSNumber *> *)selectRows {
if (!_selectRows) {
_selectRows = [NSMutableArray array];
}
return _selectRows;
}
@end