设置cell 是否是选中状态和所有选中的cell的数组
@property(nonatomic,strong)NSMutableArray *totalArr;
@property(nonatomic,assign)BOOL isSelected;
//点击选定
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
QDCollectionViewCell *cell = (QDCollectionViewCell *)[collectionView cellForItemAtIndexPath:indexPath];
if ([_totalArr containsObject:cell]) {
cell.SelectedImage.image=[UIImage imageNamed:@""];
[_totalArr removeObject:cell];
}else{
cell.SelectedImage.image=[UIImage imageNamed:@"选中"];
[_totalArr addObject:cell];
}
_isSelected=!_isSelected;
}