dennisxiaoding/DNImagePicker

再次打开,如何保持选择状态

hengchengfei opened this issue · 1 comments

比如,选择了3张照片,关了后,再次选择时,怎么让这3张保持选择状态

KIDXO commented

自定义ALAssetsLibrary,用下面替换DNImagePicker里的ALAssetsLibrary

//
// SBAssetsLibrary.h
// SocialBank
//
// Created by NULL on 16/4/7.
// Copyright © 2016年 NULL. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AssetsLibrary/AssetsLibrary.h>

@interface SBAssetsLibrary : NSObject

  • (ALAssetsLibrary *)sharedAssetsLibrary;

@EnD

//
// SBAssetsLibrary.m
// SocialBank
//
// Created by NULL on 16/4/7.
// Copyright © 2016年 NULL. All rights reserved.
//

#import "SBAssetsLibrary.h"

@implementation SBAssetsLibrary

  • (ALAssetsLibrary *)sharedAssetsLibrary
    {
    static ALAssetsLibrary *assetsLibrary = nil;
    static dispatch_once_t once;
    dispatch_once(&once, ^{
    assetsLibrary = [[ALAssetsLibrary alloc] init];
    });
    return assetsLibrary;
    }

@EnD