Giter VIP home page Giter VIP logo

custompickerview's Introduction

CustomPickerView

Does not require an agent picker view,comfy block

这是一个轻量级的pickerview

不需要设置pickerView 代理,一句话搞定 ,block 便捷返回,例子参考如下:

//一级pickerView

//displayCout 表示返回 numberOfComponentsInPickerView 数量

//数据传入数组,类似于data = @[@"obj1",@"obj2"];

    [ActionPickerView showPickerViewTitle:@"选择区域" displayCount:1 datas:data forKey1:nil forKey2:nil defineSelect:2 doneBlock:^(ActionPickerView *picker, NSInteger selectedIndex, id selectedValue) {
    
     NSLog(@"selectedIndex = %ld,value = %@",(long)selectedIndex,selectedValue);
    
    } cancelBlock:^(ActionPickerView *picker) {
   
    NSLog(@"cancel action");
    } origin:self.view];

//二级pickerView

//有二级pickerView 传入数据及参数key 自动识别判断,不需要实现代理

//data 如@[ @{ @"title":@"obj1", @"data":@[@"obj1",@"obj2"] }, @{ @"title":@"obj2", @"data":@[@"obj1",@"obj2",@"obj3",@"obj4"] } ];

//key1,key2 表示字典数据对应到pickerView 一级二级列表的key

    [ActionPickerView showPickerViewTitle:@"选择区域" displayCount:2 datas:data forKey1:@"title" forKey2:@"data" defineSelect:0 doneBlock:^(ActionPickerView *picker, NSInteger selectedIndex, id selectedValue) {
    
      NSLog(@"selectedIndex = %ld,value = %@",(long)selectedIndex,selectedValue);
    } cancelBlock:^(ActionPickerView *picker) {
      
        NSLog(@"cancel action");
    } origin:self.view];

custompickerview's People

Contributors

bowenhx avatar

Watchers

James Cloos 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.