Latest 0.0.3
Homepage https://github.com/Baichenghui/BCHPickerView
License MIT
Platforms ios 8.0, requires ARC
Authors

功能介绍

   基于UIPickerView控件封装的简单易用k的控件;只需要一个api就能实现功能,避免以往麻烦冗余的代码.选择数据之后会以block回调的形式得到数据.

用法

使用
支持iOS8.0以上

pod ‘BCHPickerView’

1.默认实现效果

代码:

[BCHPickerView bch_PickerViewInView:self.view
                                  items:self.items
                                options:@{BCHSelectedObject:self.selectedValue}
                             completion:^(BCHPickerView *view, NSInteger selectedIndex, NSString *selectedValue) {
                                 self.selectedValue = selectedValue;
                             }];

效果:

image

2.自定义效果(传一个字典即可)

代码:

[BCHPickerView bch_PickerViewInView:self.view 
                                  items:self.items
                                options:@{
                                          BCHItemHeight:@"35",
                                          BCHToolBarHeight:@"35",
                                          BCHButtonFont:[UIFont systemFontOfSize:15],
                                          BCHButtonTextColor:[UIColor colorWithRed:51/255.0 green:219 /255.0 blue:172/255.0 alpha:1.0],
                                          BCHBackgroundColor: [UIColor blueColor],
                                          BCHToolBarBackgroundColor:[UIColor redColor],
                                          BCHToolBarTopBorderColor:[UIColor groupTableViewBackgroundColor],
                                          BCHToolBarBottomBorderColor:[UIColor groupTableViewBackgroundColor],
                                          BCHSelectedObject:self.selectedValue,
                                          BCHItemBackgroundColor:[UIColor orangeColor],
                                          BCHTextColor:[UIColor cyanColor],
                                          BCHTextFont:[UIFont systemFontOfSize:20],
                                          }
                             completion:^(BCHPickerView *view, NSInteger selectedIndex, NSString *selectedValue) {
                                 NSLog(@"view:%@",view);
                                 NSLog(@"selectedIndex:%ld",selectedIndex);
                                 NSLog(@"selectedValue:%@",selectedValue);
                                 self.selectedValue = selectedValue;
    }];

效果:

image

Latest podspec

{
    "name": "BCHPickerView",
    "version": "0.0.3",
    "summary": "u57fau4e8eUIPickerViewu5c01u88c5u7684u7b80u6613u7528u7684u63a7u4ef6 BCHPickerView.",
    "description": "u57fau4e8eUIPickerViewu5c01u88c5u7684u7b80u6613u7528u7684u63a7u4ef6 BCHPickerView.",
    "homepage": "https://github.com/Baichenghui/BCHPickerView",
    "license": "MIT",
    "authors": {
        "Coder_Bai": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/Baichenghui/BCHPickerView.git",
        "tag": "0.0.3"
    },
    "source_files": [
        "BCHPickerView",
        "BCHPickerView/*.{h,m}"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This