mirror of
https://github.com/wu736139669/DoImagePicker.git
synced 2026-08-05 05:55:07 +00:00
53 lines
1.6 KiB
Objective-C
53 lines
1.6 KiB
Objective-C
//
|
|
// AssetHelper.m
|
|
// DoImagePickerController
|
|
//
|
|
// Created by Donobono on 2014. 1. 23..
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
#import <AssetsLibrary/AssetsLibrary.h>
|
|
//@class ALAssetsLibrary;
|
|
|
|
#define ASSETHELPER [AssetHelper sharedAssetHelper]
|
|
|
|
#define ASSET_PHOTO_THUMBNAIL 0
|
|
#define ASSET_PHOTO_SCREEN_SIZE 1
|
|
#define ASSET_PHOTO_FULL_RESOLUTION 2
|
|
|
|
@interface AssetHelper : NSObject
|
|
|
|
- (void)initAsset;
|
|
|
|
@property (nonatomic, strong) ALAssetsLibrary *assetsLibrary;
|
|
@property (nonatomic, strong) NSMutableArray *assetPhotos;
|
|
@property (nonatomic, strong) NSMutableArray *assetGroups;
|
|
|
|
@property (readwrite) BOOL bReverse;
|
|
|
|
+ (AssetHelper *)sharedAssetHelper;
|
|
|
|
// get album list from asset
|
|
- (void)getGroupList:(void (^)(NSArray *))result;
|
|
// get photos from specific album with ALAssetsGroup object
|
|
- (void)getPhotoListOfGroup:(ALAssetsGroup *)alGroup result:(void (^)(NSArray *))result;
|
|
// get photos from specific album with index of album array
|
|
- (void)getPhotoListOfGroupByIndex:(NSInteger)nGroupIndex result:(void (^)(NSArray *))result;
|
|
// get photos from camera roll
|
|
- (void)getSavedPhotoList:(void (^)(NSArray *))result error:(void (^)(NSError *))error;
|
|
|
|
- (NSInteger)getGroupCount;
|
|
- (NSInteger)getPhotoCountOfCurrentGroup;
|
|
- (NSDictionary *)getGroupInfo:(NSInteger)nIndex;
|
|
|
|
- (void)clearData;
|
|
|
|
// utils
|
|
- (UIImage *)getCroppedImage:(NSURL *)urlImage;
|
|
- (UIImage *)getImageFromAsset:(ALAsset *)asset type:(NSInteger)nType;
|
|
- (UIImage *)getImageAtIndex:(NSInteger)nIndex type:(NSInteger)nType;
|
|
- (ALAsset *)getAssetAtIndex:(NSInteger)nIndex;
|
|
|
|
@end
|
|
|