NBLPickerView 0.1.3

NBLPickerView 0.1.3

Maintained by yangjh.




NBLPickerView

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

NBLPickerView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'NBLPickerView'

用法一

NSArray *optionList = @[@"北京", @"天津", @"山西", @"河北"];
NBLPickerView *pickerView = [NBLPickerView showOptionList:optionList withIndexSel:1];
pickerView.constraintPickerViewHeight.constant = 200;
pickerView.titleBackgroundColor = [UIColor whiteColor];
pickerView.separatorColor = [UIColor redColor];
pickerView.labelTitle.text = @"在这里";
    
__weak typeof(self) weakSelf = self;
pickerView.blockSelectOption = ^(NSInteger index) {
    weakSelf.labelOption.text = optionList[index];
};

预览 Preview

NBLShareView_1

用法二

NBLPickerView *pickerView = [NBLPickerView showOptionList:^NSString * _Nonnull(NSInteger row) {
        return [NSString stringWithFormat:@"%@年", @(1970+row)];
    } withOptionCount:50 andIndexSel:10];
pickerView.constraintPickerViewHeight.constant = 200;
pickerView.titleBackgroundColor = [UIColor whiteColor];
pickerView.separatorColor = [UIColor blueColor];
pickerView.labelTitle.text = @"在这里";
    
__weak typeof(self) weakSelf = self;
pickerView.blockSelectOption = ^(NSInteger index) {
    weakSelf.labelOption.text = [NSString stringWithFormat:@"%@年", @(1970+index)];
};

预览 Preview

NBLShareView_2

Author

杨建红, [email protected]

License

NBLPickerView is available under the MIT license. See the LICENSE file for more info.