|
|
@@ -7,10 +7,32 @@
|
|
|
|
|
|
#import "uploadImageOrVideoViewController.h"
|
|
|
#import <AssetsLibrary/AssetsLibrary.h>
|
|
|
+#import <AVFoundation/AVFoundation.h>
|
|
|
+#import "AJPhotoListView.h"
|
|
|
+#import "AJPhotoGroupView.h"
|
|
|
+#import "AJPhotoListCell.h"
|
|
|
|
|
|
-@interface uploadImageOrVideoViewController ()
|
|
|
+@interface uploadImageOrVideoViewController ()<AJPhotoGroupViewProtocol,UICollectionViewDataSource,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout>
|
|
|
+
|
|
|
+@property (strong, nonatomic) AJPhotoGroupView *photoGroupView;
|
|
|
+@property (strong, nonatomic) UILabel *MytitleLabel;
|
|
|
+@property (strong, nonatomic) UIImageView *selectTip;
|
|
|
+@property (nonatomic) BOOL isNotAllowed;
|
|
|
+@property (strong, nonatomic) UIView *bgMaskView;
|
|
|
+@property (strong, nonatomic) AJPhotoListView *photoListView;
|
|
|
+@property (strong, nonatomic) NSMutableArray *assets;
|
|
|
+@property (strong, nonatomic) NSIndexPath *lastAccessed;
|
|
|
+
|
|
|
+//最多选择项
|
|
|
+@property (nonatomic, assign) NSInteger maximumNumberOfSelection;
|
|
|
+
|
|
|
+//最少选择项
|
|
|
+@property (nonatomic, assign) NSInteger minimumNumberOfSelection;
|
|
|
+
|
|
|
+
|
|
|
+//是否开启多选
|
|
|
+@property (nonatomic, assign) BOOL multipleSelection;
|
|
|
|
|
|
-@property (weak, nonatomic) UILabel *titleLabel;
|
|
|
@end
|
|
|
|
|
|
@implementation uploadImageOrVideoViewController
|
|
|
@@ -26,18 +48,401 @@
|
|
|
[self.navBarBGView setHidden:NO];
|
|
|
|
|
|
[self initBaselUIFun];
|
|
|
+
|
|
|
+ _isNotAllowed = YES;
|
|
|
+ _maximumNumberOfSelection = 3;
|
|
|
+ _minimumNumberOfSelection = 0;
|
|
|
+ _multipleSelection = YES;
|
|
|
+
|
|
|
+ if(!_selectionFilter)
|
|
|
+ {
|
|
|
+ _selectionFilter = [NSPredicate predicateWithValue:YES];
|
|
|
+ }
|
|
|
+ [self checkVideoAccessFun];
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- (void)initBaselUIFun
|
|
|
{
|
|
|
+ [self initNavHeadUIFun];
|
|
|
+
|
|
|
+ //列表view
|
|
|
+ [self setupPhotoListView];
|
|
|
+ //相册分组
|
|
|
+ [self setupGroupView];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)initNavHeadUIFun
|
|
|
+{
|
|
|
//title
|
|
|
UILabel *titleLabel = [[UILabel alloc] init];
|
|
|
titleLabel.textAlignment = NSTextAlignmentCenter;
|
|
|
- titleLabel.textColor = [UIColor whiteColor];
|
|
|
+ titleLabel.font = [UIFont boldSystemFontOfSize:18.0];
|
|
|
titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
|
|
|
[self.navBarBGView addSubview:titleLabel];
|
|
|
|
|
|
- self.titleLabel = titleLabel;
|
|
|
+ self.MytitleLabel = titleLabel;
|
|
|
+
|
|
|
+ //selectTipImageView
|
|
|
+ UIImageView *selectTip = [[UIImageView alloc] init];
|
|
|
+ selectTip.image = [UIImage imageNamed:@"upload_image_arrow"];
|
|
|
+ selectTip.translatesAutoresizingMaskIntoConstraints = NO;
|
|
|
+ [self.navBarBGView addSubview:selectTip];
|
|
|
+ self.selectTip = selectTip;
|
|
|
+
|
|
|
+ UIButton *tapBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
+ tapBtn.backgroundColor = [UIColor clearColor];
|
|
|
+ tapBtn.translatesAutoresizingMaskIntoConstraints = NO;
|
|
|
+ [tapBtn addTarget:self action:@selector(selectGroupAction:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ [self.navBarBGView addSubview:tapBtn];
|
|
|
+
|
|
|
+ [tapBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.centerX.mas_equalTo(self.navBarBGView.mas_centerX);
|
|
|
+ make.centerY.mas_equalTo(self.backBtn.mas_centerY);
|
|
|
+ make.width.mas_equalTo(100);
|
|
|
+ make.height.mas_equalTo(30);
|
|
|
+ }];
|
|
|
+
|
|
|
+ [self setTitleLabelText:@"所有相片"];
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark 设置相册标题
|
|
|
+- (void)setTitleLabelText:(NSString*)title
|
|
|
+{
|
|
|
+ CGFloat curWidth = [title boundingRectWithSize:CGSizeMake(SCREEN_W, 30) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:18.f]} context:nil].size.width;
|
|
|
+
|
|
|
+ self.MytitleLabel.text = title;
|
|
|
+ curWidth += 20;
|
|
|
+ //HLog(@"title w:%f",curWidth);
|
|
|
+ [self.MytitleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.centerX.mas_equalTo(self.navBarBGView.mas_centerX).offset(-10);
|
|
|
+ make.centerY.mas_equalTo(self.backBtn.mas_centerY);
|
|
|
+ make.width.mas_equalTo(curWidth);
|
|
|
+ make.height.mas_equalTo(30);
|
|
|
+ }];
|
|
|
+ //self.MytitleLabel.backgroundColor = [UIColor greenColor];
|
|
|
+
|
|
|
+ [self.selectTip mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(self.MytitleLabel.mas_right).offset(2);
|
|
|
+ make.centerY.mas_equalTo(self.backBtn.mas_centerY);
|
|
|
+ make.width.mas_equalTo(15);
|
|
|
+ make.height.mas_equalTo(15);
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark 判断手机相册权限
|
|
|
+- (void)checkVideoAccessFun
|
|
|
+{
|
|
|
+ AVAuthorizationStatus authStatus =[AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
|
|
|
+ //判断摄像头状态是否可用
|
|
|
+ if(authStatus==AVAuthorizationStatusAuthorized){
|
|
|
+ _isNotAllowed = NO;
|
|
|
+ }else{
|
|
|
+ NSLog(@"未开启相机权限,请前往设置中开启");
|
|
|
+ [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {
|
|
|
+ if (granted){
|
|
|
+ self->_isNotAllowed = NO;
|
|
|
+// mainBlock(^{
|
|
|
+//
|
|
|
+// });
|
|
|
+ }
|
|
|
+ }];
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 照片列表
|
|
|
+ */
|
|
|
+- (void)setupPhotoListView {
|
|
|
+ AJPhotoListView *collectionView = [[AJPhotoListView alloc] init];
|
|
|
+ collectionView.dataSource = self;
|
|
|
+ collectionView.delegate = self;
|
|
|
+ collectionView.translatesAutoresizingMaskIntoConstraints = NO;
|
|
|
+ [self.view insertSubview:collectionView atIndex:0];
|
|
|
+ self.photoListView = collectionView;
|
|
|
+
|
|
|
+ [collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(0);
|
|
|
+ make.right.mas_equalTo(0);
|
|
|
+ make.bottom.mas_equalTo(0);
|
|
|
+ make.top.equalTo(self.navBarBGView.mas_bottom).offset(0.f);
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 相册
|
|
|
+ */
|
|
|
+- (void)setupGroupView {
|
|
|
+ AJPhotoGroupView *photoGroupView = [[AJPhotoGroupView alloc] init];
|
|
|
+ photoGroupView.assetsFilter = self.assetsFilter;
|
|
|
+ photoGroupView.my_delegate = self;
|
|
|
+ [self.view insertSubview:photoGroupView belowSubview:self.navBarBGView];
|
|
|
+ self.photoGroupView = photoGroupView;
|
|
|
+ photoGroupView.hidden = YES;
|
|
|
+ photoGroupView.translatesAutoresizingMaskIntoConstraints = NO;
|
|
|
+
|
|
|
+ [self.photoGroupView setupGroup];
|
|
|
+
|
|
|
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
+ [photoGroupView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(0);
|
|
|
+ make.right.mas_equalTo(0);
|
|
|
+ make.height.mas_equalTo(60.0*self.photoGroupView.groups.count);
|
|
|
+ make.top.equalTo(self.navBarBGView.mas_bottom).offset(0.f);
|
|
|
+ }];
|
|
|
+ });
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark - 相册切换
|
|
|
+- (void)selectGroupAction:(UIButton *)sender {
|
|
|
+
|
|
|
+ //无权限
|
|
|
+ if (self.isNotAllowed) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (self.photoGroupView.hidden) {
|
|
|
+ [self bgMaskView];
|
|
|
+ self.bgMaskView.hidden = NO;
|
|
|
+ self.photoGroupView.hidden = NO;
|
|
|
+ [UIView animateWithDuration:0.3 animations:^{
|
|
|
+ //self.photoGroupView.transform = CGAffineTransformMakeTranslation(0, 360);
|
|
|
+ self.selectTip.transform = CGAffineTransformMakeRotation(M_PI);
|
|
|
+ }];
|
|
|
+ } else {
|
|
|
+ [self hidenGroupView];
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+- (void)hidenGroupView {
|
|
|
+ //[self.bgMaskView removeFromSuperview];
|
|
|
+ self.bgMaskView.hidden = YES;
|
|
|
+ [UIView animateWithDuration:0.3 animations:^{
|
|
|
+ //self.photoGroupView.transform = CGAffineTransformIdentity;
|
|
|
+ self.selectTip.transform = CGAffineTransformIdentity;
|
|
|
+ }completion:^(BOOL finished) {
|
|
|
+ self.photoGroupView.hidden = YES;
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+#pragma mark - 遮罩背景
|
|
|
+- (UIView *)bgMaskView {
|
|
|
+ if (_bgMaskView == nil) {
|
|
|
+ UIView *bgMaskView = [[UIView alloc] init];
|
|
|
+ bgMaskView.alpha = 0.5;
|
|
|
+ bgMaskView.translatesAutoresizingMaskIntoConstraints = NO;
|
|
|
+ bgMaskView.backgroundColor = [UIColor blackColor];
|
|
|
+ //[self.view insertSubview:bgMaskView aboveSubview:self.photoListView];
|
|
|
+ [self.view insertSubview:bgMaskView belowSubview:self.photoGroupView];
|
|
|
+
|
|
|
+ bgMaskView.userInteractionEnabled = YES;
|
|
|
+ [bgMaskView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapBgMaskView:)]];
|
|
|
+ _bgMaskView = bgMaskView;
|
|
|
+
|
|
|
+ [bgMaskView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(0);
|
|
|
+ make.right.mas_equalTo(0);
|
|
|
+ make.bottom.mas_equalTo(0);
|
|
|
+ make.top.equalTo(self.navBarBGView.mas_bottom).offset(0.f);
|
|
|
+ }];
|
|
|
+ }
|
|
|
+
|
|
|
+ return _bgMaskView;
|
|
|
+}
|
|
|
+
|
|
|
+- (void)tapBgMaskView:(UITapGestureRecognizer *)sender {
|
|
|
+ if (!self.photoGroupView.hidden) {
|
|
|
+ [self hidenGroupView];
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+#pragma mark - BoPhotoGroupViewProtocol
|
|
|
+- (void)didSelectGroup:(ALAssetsGroup *)assetsGroup {
|
|
|
+ [self loadAssets:assetsGroup];
|
|
|
+ [self setTitleLabelText:[assetsGroup valueForProperty:ALAssetsGroupPropertyName]];
|
|
|
+ [self hidenGroupView];
|
|
|
+}
|
|
|
+
|
|
|
+//加载图片
|
|
|
+- (void)loadAssets:(ALAssetsGroup *)assetsGroup {
|
|
|
+ [self.indexPathsForSelectedItems removeAllObjects];
|
|
|
+ [self.assets removeAllObjects];
|
|
|
+
|
|
|
+ //相机cell
|
|
|
+ NSMutableArray *tempList = [[NSMutableArray alloc] init];
|
|
|
+ //默认第一个为相机按钮
|
|
|
+ //[tempList addObject:[UIImage imageWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"BoPhotoPicker.bundle/images/BoAssetsCamera@2x.png"]]];
|
|
|
+
|
|
|
+ ALAssetsGroupEnumerationResultsBlock resultsBlock = ^(ALAsset *asset, NSUInteger index, BOOL *stop) {
|
|
|
+ if (asset) {
|
|
|
+ [tempList addObject:asset];
|
|
|
+ } else if (tempList.count > 0) {
|
|
|
+ //排序
|
|
|
+ NSArray *sortedList = [tempList sortedArrayUsingComparator:^NSComparisonResult(ALAsset *first, ALAsset *second) {
|
|
|
+ if ([first isKindOfClass:[UIImage class]]) {
|
|
|
+ return NSOrderedAscending;
|
|
|
+ }
|
|
|
+ id firstData = [first valueForProperty:ALAssetPropertyDate];
|
|
|
+ id secondData = [second valueForProperty:ALAssetPropertyDate];
|
|
|
+ return [secondData compare:firstData];//降序
|
|
|
+ }];
|
|
|
+ [self.assets addObjectsFromArray:sortedList];
|
|
|
+
|
|
|
+ [self.photoListView scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:YES];
|
|
|
+ [self.photoListView reloadData];
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ [assetsGroup enumerateAssetsUsingBlock:resultsBlock];
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark - uicollectionDelegate
|
|
|
+- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
|
|
+ return self.assets.count;
|
|
|
+}
|
|
|
+
|
|
|
+- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
+ static NSString *cellIdentifer = @"cell";
|
|
|
+ AJPhotoListCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellIdentifer forIndexPath:indexPath];
|
|
|
+
|
|
|
+ BOOL isSelected = [self.indexPathsForSelectedItems containsObject:self.assets[indexPath.row]];
|
|
|
+ [cell bind:self.assets[indexPath.row] selectionFilter:self.selectionFilter isSelected:isSelected];
|
|
|
+
|
|
|
+ KWeakSelf
|
|
|
+ cell.didClckSelectBut = ^(BOOL isSelect) {
|
|
|
+ [weakSelf handlCellSelectFunBy:indexPath];
|
|
|
+ };
|
|
|
+
|
|
|
+ return cell;
|
|
|
+}
|
|
|
+
|
|
|
+- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section {
|
|
|
+ return UIEdgeInsetsMake(5, 5, 5, 5);
|
|
|
+}
|
|
|
+
|
|
|
+- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
+ CGFloat wh = (collectionView.bounds.size.width - 20)/3.0;
|
|
|
+ return CGSizeMake(wh, wh);
|
|
|
+}
|
|
|
+
|
|
|
+- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section {
|
|
|
+ return 5.0;
|
|
|
}
|
|
|
|
|
|
+- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section {
|
|
|
+ return 5.0;
|
|
|
+}
|
|
|
+
|
|
|
+- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
+ AJPhotoListCell *cell = (AJPhotoListCell *)[self.photoListView cellForItemAtIndexPath:indexPath];
|
|
|
+ ALAsset *asset = self.assets[indexPath.row];
|
|
|
+
|
|
|
+ //相机按钮处理
|
|
|
+// if ([asset isKindOfClass:[UIImage class]] && _delegate && [_delegate respondsToSelector:@selector(photoPickerTapCameraAction:)]) {
|
|
|
+// [_delegate photoPickerTapCameraAction:self];
|
|
|
+// return;
|
|
|
+// }
|
|
|
+
|
|
|
+ //单选
|
|
|
+// if (!self.multipleSelection && self.indexPathsForSelectedItems.count==1) {
|
|
|
+// //取消上一个选中
|
|
|
+// NSInteger index = [self.assets indexOfObject:self.indexPathsForSelectedItems[0]];
|
|
|
+// NSIndexPath *indexPath = [NSIndexPath indexPathForItem:index inSection:0];
|
|
|
+// AJPhotoListCell *previousCell = (AJPhotoListCell *)[self.photoListView cellForItemAtIndexPath:indexPath];
|
|
|
+// [previousCell isSelected:NO];
|
|
|
+// [self.indexPathsForSelectedItems removeAllObjects];
|
|
|
+//
|
|
|
+// //选中当前的
|
|
|
+// [self.indexPathsForSelectedItems addObject:asset];
|
|
|
+// [cell isSelected:YES];
|
|
|
+// if (_delegate && [_delegate respondsToSelector:@selector(photoPicker:didDeselectAsset:)])
|
|
|
+// [_delegate photoPicker:self didDeselectAsset:asset];
|
|
|
+// return;
|
|
|
+// }
|
|
|
+
|
|
|
+ //超出最大限制
|
|
|
+// if (self.indexPathsForSelectedItems.count >= self.maximumNumberOfSelection && ![self.indexPathsForSelectedItems containsObject:asset]) {
|
|
|
+// if (_delegate && [_delegate respondsToSelector:@selector(photoPickerDidMaximum:)])
|
|
|
+// [_delegate photoPickerDidMaximum:self];
|
|
|
+// return;
|
|
|
+// }
|
|
|
+//
|
|
|
+// //选择过滤
|
|
|
+// BOOL selectable = [self.selectionFilter evaluateWithObject:asset];
|
|
|
+// if (!selectable) {
|
|
|
+// if (_delegate && [_delegate respondsToSelector:@selector(photoPickerDidSelectionFilter:)])
|
|
|
+// [_delegate photoPickerDidSelectionFilter:self];
|
|
|
+// return;
|
|
|
+// }
|
|
|
+//
|
|
|
+// //取消选中
|
|
|
+// if ([self.indexPathsForSelectedItems containsObject:asset]) {
|
|
|
+// [self.indexPathsForSelectedItems removeObject:asset];
|
|
|
+// [cell isSelected:NO];
|
|
|
+// if (_delegate && [_delegate respondsToSelector:@selector(photoPicker:didDeselectAsset:)])
|
|
|
+// [_delegate photoPicker:self didDeselectAsset:asset];
|
|
|
+// return;
|
|
|
+// }
|
|
|
+//
|
|
|
+// //选中
|
|
|
+// [self.indexPathsForSelectedItems addObject:asset];
|
|
|
+// [cell isSelected:YES];
|
|
|
+// if (_delegate && [_delegate respondsToSelector:@selector(photoPicker:didSelectAsset:)])
|
|
|
+// [_delegate photoPicker:self didSelectAsset:asset];
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark 处理点击选中相关
|
|
|
+- (void)handlCellSelectFunBy:(NSIndexPath *)indexPath
|
|
|
+{
|
|
|
+ AJPhotoListCell *cell = (AJPhotoListCell *)[self.photoListView cellForItemAtIndexPath:indexPath];
|
|
|
+ ALAsset *asset = self.assets[indexPath.row];
|
|
|
+
|
|
|
+ //超出最大限制
|
|
|
+ if (self.indexPathsForSelectedItems.count >= self.maximumNumberOfSelection && ![self.indexPathsForSelectedItems containsObject:asset]) {
|
|
|
+ if (_delegate && [_delegate respondsToSelector:@selector(photoPickerDidMaximum:)])
|
|
|
+ [_delegate photoPickerDidMaximum:self];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //选择过滤
|
|
|
+ BOOL selectable = [self.selectionFilter evaluateWithObject:asset];
|
|
|
+ if (!selectable) {
|
|
|
+ if (_delegate && [_delegate respondsToSelector:@selector(photoPickerDidSelectionFilter:)])
|
|
|
+ [_delegate photoPickerDidSelectionFilter:self];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //取消选中
|
|
|
+ if ([self.indexPathsForSelectedItems containsObject:asset]) {
|
|
|
+ [self.indexPathsForSelectedItems removeObject:asset];
|
|
|
+ [cell isSelected:NO];
|
|
|
+ if (_delegate && [_delegate respondsToSelector:@selector(photoPicker:didDeselectAsset:)])
|
|
|
+ [_delegate photoPicker:self didDeselectAsset:asset];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //选中
|
|
|
+ [self.indexPathsForSelectedItems addObject:asset];
|
|
|
+ [cell isSelected:YES];
|
|
|
+ if (_delegate && [_delegate respondsToSelector:@selector(photoPicker:didSelectAsset:)])
|
|
|
+ [_delegate photoPicker:self didSelectAsset:asset];
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark - getter/setter
|
|
|
+- (NSMutableArray *)assets {
|
|
|
+ if (!_assets) {
|
|
|
+ _assets = [[NSMutableArray alloc] init];
|
|
|
+ }
|
|
|
+ return _assets;
|
|
|
+}
|
|
|
+
|
|
|
+- (NSMutableArray *)indexPathsForSelectedItems {
|
|
|
+ if (!_indexPathsForSelectedItems) {
|
|
|
+ _indexPathsForSelectedItems = [[NSMutableArray alloc] init];
|
|
|
+ }
|
|
|
+ return _indexPathsForSelectedItems;
|
|
|
+}
|
|
|
@end
|