Skip to content

Commit

Permalink
change read me delete some unused
Browse files Browse the repository at this point in the history
  • Loading branch information
qtdc1229 committed Jan 18, 2016
1 parent d973245 commit 59ff33b
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DCPickerRecord/DCPickerRecord/DCPickerRecordModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

@interface DCPickerRecordModel : NSObject <DCPickerRecordModelProtocol>

@property (nonatomic ,copy) id (^dc_didSelectedBlock)();
@property (nonatomic ,copy) void (^dc_didSelectedBlock)();
@property (nonatomic, readonly) NSInteger numberOfComponent;
@property (nonatomic, readonly) NSMutableArray *rowOfComponent;

Expand Down
2 changes: 1 addition & 1 deletion DCPickerRecord/DCPickerRecord/DCPickerRecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN

+ (instancetype)shareRecorder;

- (void)dc_pickerView:(nonnull UIPickerView *)pickerView recordDataClass:(Class)dataClass didSelectedAction:(id (^)())didSelectedAction;
- (void)dc_pickerView:(nonnull UIPickerView *)pickerView recordDataClass:(Class)dataClass didSelectedAction:(void (^)())didSelectedAction;

@end
NS_ASSUME_NONNULL_END
2 changes: 1 addition & 1 deletion DCPickerRecord/DCPickerRecord/DCPickerRecorder.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ + (instancetype)shareRecorder {
return __shareDCPickerSourceRecorder;
}

- (void)dc_pickerView:(UIPickerView *)pickerView recordDataClass:(Class)dataClass didSelectedAction:(id (^)())didSelectedAction {
- (void)dc_pickerView:(UIPickerView *)pickerView recordDataClass:(Class)dataClass didSelectedAction:(void (^)())didSelectedAction {
NSAssert(pickerView, @"pickerView must nonull");
if ([dataClass isSubclassOfClass:[DCPickerRecordModel class]]) {
_pickerDataClass = dataClass;
Expand Down
3 changes: 1 addition & 2 deletions DCPickerRecord/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ - (void)viewDidLoad {
[super viewDidLoad];
[[DCPickerRecorder shareRecorder] dc_pickerView:self.pickerView
recordDataClass:NSClassFromString(@"CityPickers")
didSelectedAction:^id(NSIndexPath *index,CityModel *city) {
didSelectedAction:^void(NSIndexPath *index,CityModel *city) {
self.label.text = [NSString stringWithFormat:@"选择了 %@%@",city.province,city.name];
return nil;
}];
// [self.pickerView reloadAllComponents];
// Do any additional setup after loading the view, typically from a nib.
Expand Down
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
# DCPickerRecord
Quick recoder for UIPickerView

##简介
DCPickerRecord 是用来简化UIPickerView 管理以及使用的组件。

以往使用Picker 需要实现UIPicker 的代理,


```objective-c
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
NSString *ret = @"";
// ret = 你某一行显示的内容
return ret;
}

-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
//选择某一行后的行动
}

- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
NSInteger ret = 0;
return ret;
}

-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
NSInteger ret = 0;
return ret;
}
```

Picker 的选择记录记录比较混乱。

0 comments on commit 59ff33b

Please sign in to comment.