Skip to content

Commit

Permalink
Minor updates #34
Browse files Browse the repository at this point in the history
  • Loading branch information
iTofu committed Apr 26, 2017
1 parent 2fdb8ed commit 0a40e53
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Demo/LCActionSheetDemo/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
});
}

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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<NSString *> *)titles atIndexSet:(NSIndexSet *)indexSet;
- (void)appendButtonsWithTitles:(NSArray<NSString *> *)titles atIndexex:(NSIndexSet *)indexes;

@end
```
Expand Down
4 changes: 2 additions & 2 deletions Sources/LCActionSheet.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<NSString *> *)titles atIndexSet:(NSIndexSet *)indexSet;
- (void)appendButtonsWithTitles:(NSArray<NSString *> *)titles atIndexex:(NSIndexSet *)indexes;

/**
Show the instance of LCActionSheet.
Expand Down
8 changes: 4 additions & 4 deletions Sources/LCActionSheet.m
Original file line number Diff line number Diff line change
Expand Up @@ -389,16 +389,16 @@ - (void)appendButtonWithTitle:(NSString *)title atIndex:(NSUInteger)index {
[self updateTableView];
}

- (void)appendButtonsWithTitles:(NSArray<NSString *> *)titles atIndexSet:(NSIndexSet *)indexSet {
- (void)appendButtonsWithTitles:(NSArray<NSString *> *)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];
Expand Down

0 comments on commit 0a40e53

Please sign in to comment.