相册多选 YSHYAssetsPickerDemo

软件介绍

相册多选功能实现,在需要调用相册的地方,添加如下代码即可:

    YSHYAssetPickerController *picker = [[YSHYAssetPickerController alloc]initWithNumber:5 andHasSelectedImags:dataSource];//最多只能选5张 并传入已经选好的图片数组
    picker.assetsFilter = [ALAssetsFilter allPhotos];

    picker.showEmptyGroups = NO;

    picker.pickerDelegate = self;

    picker.selectionFilter = [NSPredicate predicateWithBlock:^BOOL(id evaluatedObject,NSDictionary *bindings){
        if ([[(ALAsset *)evaluatedObject valueForProperty:ALAssetPropertyType]isEqual:ALAssetTypeVideo]) {
            NSTimeInterval duration = [[(ALAsset *)evaluatedObject valueForProperty:ALAssetPropertyDuration]doubleValue];
            return duration >= 5;
        }else{
            return  YES;
        }
    }];

    [self presentViewController:picker animated:YES completion:^{
    }];

实现其代理方法:

-(void)assetPickerController:(YSHYAssetPickerController *)picker didFinishPickingAssets:(NSArray *)assets {

 [dataSource removeAllObjects];

 [dataSource addObjectsFromArray:assets];

  [self CreatImageViewWithImags:dataSource];

}

本文地址:https://www.codercto.com/soft/d/25135.html

Hacker's Delight

Hacker's Delight

Henry S. Warren Jr. / Addison-Wesley / 2002-7-27 / USD 59.99

A collection useful programming advice the author has collected over the years; small algorithms that make the programmer's task easier. * At long last, proven short-cuts to mastering difficult aspec......一起来看看 《Hacker's Delight》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具