Latest 0.0.1
Homepage https://github.com/CaryGo/CAPickerView
License MIT
Platforms ios , requires ARC
Frameworks Foundation, UIKit
Authors

PickerView的封装

导入CAPickerView

使用Cocoapods

pod 'CAPickerView'

手动导入

下载项目,将Class文件中的CAPickerView类导入工程,不需要做额外配置

使用CAPickerView

  • (IBAction)action:(id)sender {
    NSArray array = @[@[@"昨天",@"今天",@"明天"],@[@"昨天",@"今天",@"明天"],@[@"昨天",@"今天",@"明天"]];
    CAPickerView
    picker = [[CAPickerView alloc] initWithTitle:@"哈哈哈" delegate:self dataArray:array];
    [picker showInView:self.view];
    }
  • (IBAction)action2:(id)sender {
    NSMutableArray array = [NSMutableArray array];
    NSMutableArray
    tempArray = [NSMutableArray array];
    for (int i=2016; i<=2020; i++) {
    [tempArray addObject:@(i)];
    }
    [array addObject:tempArray];
    tempArray = [NSMutableArray array];
    for (int i=1; i<=12; i++) {
    [tempArray addObject:@(i)];
    }
    [array addObject:tempArray];
    tempArray = [NSMutableArray array];
    for (int i=1; i<=30; i++) {
    [tempArray addObject:@(i)];
    }
    [array addObject:tempArray];
    tempArray = [NSMutableArray array];
    CAPickerView * picker = [[CAPickerView alloc] initWithTitle:@"年月日" delegate:self dataArray:array];
    picker.unitArray = [NSMutableArray arrayWithObjects:@"年",@"月",@"日", nil];
    [picker showInView:self.view];
    }

    pragma mark — CAPickerViewDelegate

  • (void)pickerViewDidFinishSelected:(CAPickerView )pickerView array:(NSArray )array{
    NSLog(@"%@",array);
    }
  • (void)pickerViewDidCancel{
    }

LICENSE

MIT

Latest podspec

{
    "name": "CAPickerView",
    "version": "0.0.1",
    "summary": "CAPickerView.",
    "description": "pickerViewu7684u4f7fu7528u3002",
    "homepage": "https://github.com/CaryGo/CAPickerView",
    "license": "MIT",
    "authors": {
        "Cary": "[email protected]"
    },
    "platforms": {
        "ios": null
    },
    "source": {
        "git": "https://github.com/CaryGo/CAPickerView.git",
        "tag": "0.0.1"
    },
    "source_files": [
        "Class",
        "Class/**/*.{h,m}"
    ],
    "frameworks": [
        "Foundation",
        "UIKit"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This