// // XZPickView.h // XZPickView // // Created by 赵永杰 on 17/3/24. // Copyright © 2017年 zhaoyongjie. All rights reserved. // #import @class XZPickView; @protocol XZPickViewDataSource @required - (NSInteger)numberOfComponentsInPickerView:(XZPickView *)pickerView; - (NSInteger)pickerView:(XZPickView *)pickerView numberOfRowsInComponent:(NSInteger)component; @end @protocol XZPickViewDelegate - (NSString *)pickerView:(XZPickView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component; - (void)pickView:(XZPickView *)pickerView confirmButtonClick:(UIButton *)button; @optional - (NSAttributedString *)pickerView:(XZPickView *)pickerView attributedTitleForRow:(NSInteger)row forComponent:(NSInteger)componen; - (void)pickerView:(XZPickView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component; @end @interface XZPickView : UIView @property (nonatomic, weak) id delegate; @property (nonatomic, weak) id dataSource; - (instancetype)initWithFrame:(CGRect)frame title:(NSString *)title; - (void)show; - (void)dismiss; // 选中某一行 - (void)selectRow:(NSInteger)row inComponent:(NSInteger)component animated:(BOOL)animated; // 获取当前选中的row - (NSInteger)selectedRowInComponent:(NSInteger)component; //刷新某列数据 -(void)pickReloadComponent:(NSInteger)component; //刷新数据 -(void)reloadData; @end