iOS pickView封装(自用)

作者: boundlessocean | 来源:发表于2016-11-22 17:54 被阅读196次

    pickView

    pickView的封装,将数据源与代理抛出

    地址:
    https://github.com/boundlessocean/pickView.git

    使用方法:
    1.初始化

        _pickView = [[BLPickerView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 150)];
        _pickView.pickViewDelegate = self;
        _pickView.pickViewDataSource = self;
        _pickView.buttonClickedBlock = ^(BOOL isSureButton){
            NSLog(@"%@",isSureButton ? @"确定按钮点击":@"取消按钮点击");
        };
        [_pickView bl_show];
    

    2.实现数据源代理的相关方法提供数据

    - (NSInteger)bl_numberOfComponentsInPickerView:(UIPickerView *)pickerView{
    }
    
    - (NSInteger)bl_pickerView:(UIPickerView *)pickerView
       numberOfRowsInComponent:(NSInteger)component{
    }
    
    - (NSString *)bl_pickerView:(UIPickerView *)pickerView
                    titleForRow:(NSInteger)row
                   forComponent:(NSInteger)component{
    }
    
    - (CGFloat)bl_pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component{
    }
    
    - (void)bl_pickerView:(UIPickerView *)pickerView
             didSelectRow:(NSInteger)row
              inComponent:(NSInteger)component{
    }
    

    相关文章

      网友评论

        本文标题:iOS pickView封装(自用)

        本文链接:https://www.haomeiwen.com/subject/wgfmpttx.html