Latest 1.0.0
Homepage https://github.com/potato512/SYLibraryPhoto
License MIT
Platforms ios 7.0, requires ARC
Frameworks UIKit, AssetsLibrary
Authors

Get images from AssetsLibrary
从相册获取最新的,或最久的N张相片

  • 使用介绍
    • 自动导入:使用命令pod 'SYLibraryPhoto'导入到项目中
    • 手动导入:或下载源码后,将源码添加到项目中
    • 手动导入时,需要添加AssetsLibrary.framework

使用说明:

导入头文件

#import "SYLibraryPhoto.h"

定义属性,并实例化

@property (nonatomic, strong) SYLibraryPhoto *photoHelper;

self.photoHelper = [[PhotoHelper alloc] init];

获取相册第一张图片,即最老的一张图片

[self.photoHelper GetImageFirst:^(NSArray *images) {

} error:^{
    NSLog(@"error get first image");
}];

获取相册最后一张图片,即最新的一张图片

[self.photoHelper GetImagelast:^(NSArray *images) {

} error:^{
    NSLog(@"error get last image");
}];

获取相册倒数第二张图片

[self.photoHelper GetImagelastSec:^(NSArray *images) {

} error:^{
    NSLog(@"error get last image");
}];

获取相册全部图片

[self.photoHelper GetImagesWithNum:0 latest:YES start:^{

} success:^(NSArray *images) {

} error:^{
    NSLog(@"error get last image");
}];

获取相册最老的10张图片

[self.photoHelper GetImagesWithNum:10 latest:NO start:^{

} success:^(NSArray *images) {

} error:^{
    NSLog(@"error get last image");
}];

获取相册最新的10张图片

[self.photoHelper GetImagesWithNum:10 latest:YES start:^{

} success:^(NSArray *images) {

} error:^{
    NSLog(@"error get last image");
}];

效果图

LibraryPhoto

修改完善

  • 20180802
    • 版本号:1.0.0
    • 源码修改

Latest podspec

{
    "name": "SYLibraryPhoto",
    "version": "1.0.0",
    "summary": "SYLibraryPhoto used to select photo from AssetsLibrary.",
    "homepage": "https://github.com/potato512/SYLibraryPhoto",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "herman": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/potato512/SYLibraryPhoto.git",
        "tag": "1.0.0"
    },
    "source_files": "SYLibraryPhoto/*.{h,m}",
    "frameworks": [
        "UIKit",
        "AssetsLibrary"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This