Git Product home page Git Product logo

zlassetspickerdemo's Introduction

// 创建图片多选控制器
PickerViewController *pickerVc = [[PickerViewController alloc] init];
// 默认显示相册里面的内容SavePhotos
PickerVc.status = PickerViewShowStatusSavePhotos;
// 选择图片的最小数,默认是9张图片最大也是9张
pickerVc.minCount = 4; 
[self presentViewController:pickerVc animated:YES completion:nil];

// block回调或者代理
// 用block来代替代理
pickerVc.delegate = self;    
/**
 *
 传值可以用代理,或者用block来接收,以下是block的传值
 __weak typeof(self) weakSelf = self;
 pickerVc.callBack = ^(NSArray *assets){
    weakSelf.assets = assets;
    [weakSelf.tableView reloadData];
 };
 */    

// 代理回调方法
- (void)pickerViewControllerDoneAsstes:(NSArray *)assets{
  self.assets = assets;
  [self.tableView reloadData];
}

// 图片游览器
ZLPickerBrowserViewController *pickerBrowser = [[ZLPickerBrowserViewController alloc] init];
// 传入点击图片View的话,会有微信朋友圈照片的风格
pickerBrowser.toView = cell.imageView;
// 数据源/delegate
pickerBrowser.delegate = self;
pickerBrowser.dataSource = self;
// 是否可以删除照片
pickerBrowser.editing = YES;
// 当前选中的值
pickerBrowser.currentPage = indexPath.row;
// 展示控制器
[pickerBrowser show];

#pragma mark - 自定义动画
// 你也可以自定义动画
// 参考BaseAnimationView
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{

    UIView *boxView = [[UIView alloc] init];
    boxView.backgroundColor = [UIColor redColor];

    NSDictionary *options = @{
                              UIViewAnimationInView:self.view,
                              UIViewAnimationToView:boxView,
                              };


    [ZLAnimationBaseView animationViewWithOptions:options animations:^{
        // TODO .. 执行动画时
    } completion:^(ZLAnimationBaseView *baseView) {
        // TODO .. 动画执行完时
    }];
}

zlassetspickerdemo's People

Contributors

makezl avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.