Skip to content

Commit

Permalink
Fixes typo - ActionMultopleStringCancelBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
markrickert committed Aug 22, 2015
1 parent c99257a commit d5f423a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions Pickers/ActionSheetMultipleStringPicker.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

@class ActionSheetMultipleStringPicker;
typedef void(^ActionMultipleStringDoneBlock)(ActionSheetMultipleStringPicker *picker, NSArray *selectedIndexes, id selectedValues);
typedef void(^ActionMultopleStringCancelBlock)(ActionSheetMultipleStringPicker *picker);
typedef void(^ActionMultipleStringCancelBlock)(ActionSheetMultipleStringPicker *picker);

@interface ActionSheetMultipleStringPicker : AbstractActionSheetPicker <UIPickerViewDelegate, UIPickerViewDataSource>
/**
Expand All @@ -55,11 +55,11 @@ typedef void(^ActionMultopleStringCancelBlock)(ActionSheetMultipleStringPicker *



+ (instancetype)showPickerWithTitle:(NSString *)title rows:(NSArray *)strings initialSelection:(NSArray *)indexes doneBlock:(ActionMultipleStringDoneBlock)doneBlock cancelBlock:(ActionMultopleStringCancelBlock)cancelBlock origin:(id)origin;
+ (instancetype)showPickerWithTitle:(NSString *)title rows:(NSArray *)strings initialSelection:(NSArray *)indexes doneBlock:(ActionMultipleStringDoneBlock)doneBlock cancelBlock:(ActionMultipleStringCancelBlock)cancelBlock origin:(id)origin;

- (instancetype)initWithTitle:(NSString *)title rows:(NSArray *)strings initialSelection:(NSArray *)indexes doneBlock:(ActionMultipleStringDoneBlock)doneBlock cancelBlock:(ActionMultopleStringCancelBlock)cancelBlockOrNil origin:(id)origin;
- (instancetype)initWithTitle:(NSString *)title rows:(NSArray *)strings initialSelection:(NSArray *)indexes doneBlock:(ActionMultipleStringDoneBlock)doneBlock cancelBlock:(ActionMultipleStringCancelBlock)cancelBlockOrNil origin:(id)origin;

@property (nonatomic, copy) ActionMultipleStringDoneBlock onActionSheetDone;
@property (nonatomic, copy) ActionMultopleStringCancelBlock onActionSheetCancel;
@property (nonatomic, copy) ActionMultipleStringCancelBlock onActionSheetCancel;

@end
26 changes: 13 additions & 13 deletions Pickers/ActionSheetMultipleStringPicker.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ @interface ActionSheetMultipleStringPicker()

@implementation ActionSheetMultipleStringPicker

+ (instancetype)showPickerWithTitle:(NSString *)title rows:(NSArray *)strings initialSelection:(NSArray *)indexes doneBlock:(ActionMultipleStringDoneBlock)doneBlock cancelBlock:(ActionMultopleStringCancelBlock)cancelBlockOrNil origin:(id)origin {
+ (instancetype)showPickerWithTitle:(NSString *)title rows:(NSArray *)strings initialSelection:(NSArray *)indexes doneBlock:(ActionMultipleStringDoneBlock)doneBlock cancelBlock:(ActionMultipleStringCancelBlock)cancelBlockOrNil origin:(id)origin {
ActionSheetMultipleStringPicker * picker = [[ActionSheetMultipleStringPicker alloc] initWithTitle:title rows:strings initialSelection:indexes doneBlock:doneBlock cancelBlock:cancelBlockOrNil origin:origin];
[picker showActionSheetPicker];
return picker;
}

- (instancetype)initWithTitle:(NSString *)title rows:(NSArray *)strings initialSelection:(NSArray *)indexes doneBlock:(ActionMultipleStringDoneBlock)doneBlock cancelBlock:(ActionMultopleStringCancelBlock)cancelBlockOrNil origin:(id)origin {
- (instancetype)initWithTitle:(NSString *)title rows:(NSArray *)strings initialSelection:(NSArray *)indexes doneBlock:(ActionMultipleStringDoneBlock)doneBlock cancelBlock:(ActionMultipleStringCancelBlock)cancelBlockOrNil origin:(id)origin {
self = [self initWithTitle:title rows:strings initialSelection:indexes target:nil successAction:nil cancelAction:nil origin:origin];
if (self) {
self.onActionSheetDone = doneBlock;
Expand Down Expand Up @@ -78,18 +78,18 @@ - (UIView *)configuredPickerView {
stringPicker.dataSource = self;

[self performInitialSelectionInPickerView:stringPicker];

if (self.data.count == 0) {
stringPicker.showsSelectionIndicator = NO;
stringPicker.userInteractionEnabled = NO;
} else {
stringPicker.showsSelectionIndicator = YES;
stringPicker.userInteractionEnabled = YES;
}

//need to keep a reference to the picker so we can clear the DataSource / Delegate when dismissing
self.pickerView = stringPicker;

return stringPicker;
}

Expand Down Expand Up @@ -137,33 +137,33 @@ - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSIn

- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
id obj = (self.data)[(NSUInteger) row];

// return the object if it is already a NSString,
// otherwise, return the description, just like the toString() method in Java
// else, return nil to prevent exception

if ([obj isKindOfClass:[NSString class]])
return obj;

if ([obj respondsToSelector:@selector(description)])
return [obj performSelector:@selector(description)];

return nil;
}

- (NSAttributedString *)pickerView:(UIPickerView *)pickerView attributedTitleForRow:(NSInteger)row forComponent:(NSInteger)component {
id obj = (self.data)[component][(NSUInteger) row];

// return the object if it is already a NSString,
// otherwise, return the description, just like the toString() method in Java
// else, return nil to prevent exception

if ([obj isKindOfClass:[NSString class]])
return [[NSAttributedString alloc] initWithString:obj attributes:self.pickerTextAttributes];

if ([obj respondsToSelector:@selector(description)])
return [[NSAttributedString alloc] initWithString:[obj performSelector:@selector(description)] attributes:self.pickerTextAttributes];

return nil;
}

Expand Down

0 comments on commit d5f423a

Please sign in to comment.