diff --git a/Demo/LCActionSheetDemo/ViewController.m b/Demo/LCActionSheetDemo/ViewController.m index 2371d54..e992485 100644 --- a/Demo/LCActionSheetDemo/ViewController.m +++ b/Demo/LCActionSheetDemo/ViewController.m @@ -103,7 +103,7 @@ - (IBAction)showBlockActionSheet { NSMutableIndexSet *set = [[NSMutableIndexSet alloc] init]; [set addIndex:1]; [set addIndex:2]; - [actionSheet appendButtonsWithTitles:@[@"Hello", @"World"] atIndexSet:set]; + [actionSheet appendButtonsWithTitles:@[@"Hello", @"World"] atIndexes:set]; }); } diff --git a/README.md b/README.md index a35e95e..2ed3c32 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ In me the tiger sniffs the rose. NSMutableIndexSet *set = [[NSMutableIndexSet alloc] init]; [set addIndex:1]; [set addIndex:2]; - [actionSheet appendButtonsWithTitles:@[@"Hello", @"World"] atIndexSet:set]; + [actionSheet appendButtonsWithTitles:@[@"Hello", @"World"] atIndexes:set]; }); [actionSheet show]; @@ -288,7 +288,7 @@ In me the tiger sniffs the rose. - (void)appendButtonWithTitle:(nullable NSString *)title atIndex:(NSUInteger)index; // Append buttons at indexes with titles. - - (void)appendButtonsWithTitles:(NSArray *)titles atIndexSet:(NSIndexSet *)indexSet; + - (void)appendButtonsWithTitles:(NSArray *)titles atIndexex:(NSIndexSet *)indexes; @end ``` diff --git a/Sources/LCActionSheet.h b/Sources/LCActionSheet.h index a66c92d..3f173c1 100644 --- a/Sources/LCActionSheet.h +++ b/Sources/LCActionSheet.h @@ -374,12 +374,12 @@ typedef void(^LCActionSheetDidDismissHandler)(LCActionSheet *actionSheet, NSUInt - (void)appendButtonWithTitle:(nullable NSString *)title atIndex:(NSUInteger)index; /** - Append buttons at indexes with titles. + Append buttons at indexSet with titles. @param titles titles @param indexSet indexSet */ -- (void)appendButtonsWithTitles:(NSArray *)titles atIndexSet:(NSIndexSet *)indexSet; +- (void)appendButtonsWithTitles:(NSArray *)titles atIndexex:(NSIndexSet *)indexes; /** Show the instance of LCActionSheet. diff --git a/Sources/LCActionSheet.m b/Sources/LCActionSheet.m index 4506851..31ebcbc 100644 --- a/Sources/LCActionSheet.m +++ b/Sources/LCActionSheet.m @@ -389,16 +389,16 @@ - (void)appendButtonWithTitle:(NSString *)title atIndex:(NSUInteger)index { [self updateTableView]; } -- (void)appendButtonsWithTitles:(NSArray *)titles atIndexSet:(NSIndexSet *)indexSet { +- (void)appendButtonsWithTitles:(NSArray *)titles atIndexes:(NSIndexSet *)indexes { #ifdef DEBUG - NSAssert(titles.count == indexSet.count, @"Count of titles differs from count of indexs"); + NSAssert(titles.count == indexes.count, @"Count of titles differs from count of indexs"); #endif NSMutableIndexSet *indexSetM = [[NSMutableIndexSet alloc] init]; - [indexSet enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL * _Nonnull stop) { + [indexes enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL * _Nonnull stop) { #ifdef DEBUG NSAssert(idx != 0, @"Index 0 is cancel button"); - NSAssert(idx <= self.otherButtonTitles.count + indexSet.count, @"Index crossed"); + NSAssert(idx <= self.otherButtonTitles.count + indexes.count, @"Index crossed"); #endif [indexSetM addIndex:idx - 1];