Latest 0.0.3
Homepage https://github.com/XiaoHanGe/HJQAssetsPicker
License LICENSE
Platforms ios 7.0, requires ARC
Frameworks Photos, AddressBook
Authors

CircleCI
Version
Coveralls branch
Packagist
Platform
Apps Using
CocoaPods

HJQAssetsPicker简介

一款仿微信多选照片库


Installation【安装】

From CocoaPods【使用CocoaPods】

pod  “HJQAssetsPicker”

Manually【手动导入】

  • Drag all source files under floder HJQAssetsPicker to your project.【将HJQAssetsPicker文件夹中的所有源代码拽入项目中】

使用方法

请看Demo

首先倒入框架#import "HJQImagePickerNavController.h"
- (HJQImagePickerNavController *)navPicVC
{
    if (!_navPicVC) {
        _navPicVC = [[HJQImagePickerNavController alloc] init];
        _navPicVC.navDelegate = self;
        _navPicVC.maxSelectNumber = 9;
    }
    return _navPicVC;
}

- (IBAction)aansdfnansd:(id)sender {

    [self presentViewController:self.navPicVC animated:YES completion:nil];

    [self.navPicVC showFirstAssetsController];

}

实现YImageNavControllerDelegate代理方法:
- (void)imagePickerNavController:(HJQImagePickerNavController *)navControlelr DidFinshed:(NSMutableArray *)selectedArray;
{
    NSLog(@"照片个数  %ld 张",selectedArray.count);
    [self dismissViewControllerAnimated:YES completion:^{
        NSLog(@"这里可以写回调后的事件");
    }];
}

其他API


  • 获取相册最后一张图片
  • - (void)getCameraRollAlbumLastImage:(void(^)(UIImage *placeHoderImage,id asset))completion;
  • - (void)getCameraRollAlbumLastImage:(void(^)(UIImage *placeHoderImage,id asset))completion;

  • Get Album 获得相册/相册数组
  • - (void)getCameraRollAlbumcompletion:(void (^)(YAlbumModel *model))completion;

  • 获取所有相册数据
  • - (void)getAllAlbumscompletion:(void (^)(NSArray<YAlbumModel *> *models))completion;

  • 获取某个相册里所有照片
  • - (void)getAssetsFromFetchResult:(id)result completion:(void (^)(NSArray<YAssetsModel *> *models))completion;
  • - (void)getAssetFromFetchResult:(id)result atIndex:(NSInteger)index completion:(void (^)(YAssetsModel *model))completion;

  • Get photo 获得照片封面
  • - (void)getPostImageWithAlbumModel:(YAlbumModel *)model completion:(void (^)(UIImage *postImage))completion;

  • 获取屏幕大小尺寸图片
  • - (void)getPhotoWithAsset:(id)asset completion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion;

  • 获取制定宽度的图片
  • - (void)getPhotoWithAsset:(id)asset photoWidth:(CGFloat)photoWidth isSynchronous:(BOOL)isSynchronous completion:(void (^)(UIImage *photo,NSDictionary *info,BOOL isDegraded))completion;

  • 获取原图
  • - (void)getOriginalPhotoWithAsset:(id)asset completion:(void (^)(UIImage *photo,NSDictionary *info))completion;

  • 获取系统图片的Data
  • - (void)getImageDataWithAsset:(id)asset completion:(void (^)(NSData *imageData))completion;

关于作者 小韩哥-CSDN

iOS开发者交流群:446310206

Latest podspec

{
    "name": "HJQAssetsPicker",
    "version": "0.0.3",
    "license": "LICENSE",
    "homepage": "https://github.com/XiaoHanGe/HJQAssetsPicker",
    "authors": {
        "u97e9u4fcau5f3a": "[email protected]"
    },
    "summary": "u4effu5faeu4fe1u5355u9009u590du9009u56feu7247",
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/XiaoHanGe/HJQAssetsPicker.git",
        "tag": "0.0.3"
    },
    "source_files": "HJQAssetsPicker/**/*.{h,m}",
    "frameworks": [
        "Photos",
        "AddressBook"
    ],
    "requires_arc": true,
    "resources": "HJQAssetsPicker/HJQAssetsPicker.bundle"
}

Pin It on Pinterest

Share This