NBLPickerView 0.1.3

NBLPickerView 0.1.3

yangjh 维护。




NBLPickerView

CI Status Version License Platform

示例

要运行示例项目,请克隆仓库,然后首先从 Example 目录中运行 pod install

要求

安装

NBLPickerView 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 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

作者

杨建红, [email protected]

许可证

NBLPickerView 在MIT许可证下可用。更多信息请参阅LICENSE文件。