pickView
pickView的封裝顾患,將數(shù)據(jù)源與代理拋出
地址:
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.實現(xiàn)數(shù)據(jù)源代理的相關方法提供數(shù)據(jù)
- (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{
}