Skip to content

Commit

Permalink
Merge pull request #82 from bkoatz/master
Browse files Browse the repository at this point in the history
Add index path to cellForMentionsEntity delegate call
  • Loading branch information
jmkk authored Oct 4, 2018
2 parents 88889d6 + 371666d commit 76185ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Hakawai/Mentions/HKWMentionsCreationStateMachine.m
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
NSAssert(indexPath.row >= 0 && indexPath.row < [self.entityArray count],
@"Entity chooser table view requested a cell with an out-of-bounds index path row.");
id<HKWMentionsEntityProtocol> entity = self.entityArray[indexPath.row];
return [self.delegate cellForMentionsEntity:entity withMatchString:[self.stringBuffer copy] tableView:tableView];
return [self.delegate cellForMentionsEntity:entity withMatchString:[self.stringBuffer copy] tableView:tableView atIndexPath:indexPath];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
Expand Down
3 changes: 2 additions & 1 deletion Hakawai/Mentions/HKWMentionsPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ typedef NS_ENUM(NSInteger, HKWMentionsPluginState) {
*/
- (UITableViewCell *)cellForMentionsEntity:(id<HKWMentionsEntityProtocol>)entity
withMatchString:(NSString *)matchString
tableView:(UITableView *)tableView;
tableView:(UITableView *)tableView
atIndexPath:(NSIndexPath *)indexPath;

/*!
Return the height of the table view cell for a given mention entity in the chooser view.
Expand Down
5 changes: 3 additions & 2 deletions Hakawai/Mentions/HKWMentionsPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -1610,8 +1610,9 @@ - (void)asyncRetrieveEntitiesForKeyString:(NSString *)keyString
- (UITableViewCell *)cellForMentionsEntity:(id<HKWMentionsEntityProtocol>)entity
withMatchString:(NSString *)matchString
tableView:(UITableView *)tableView {
return [self.delegate cellForMentionsEntity:entity withMatchString:matchString tableView:tableView];
tableView:(UITableView *)tableView
atIndexPath:(NSIndexPath *)indexPath {
return [self.delegate cellForMentionsEntity:entity withMatchString:matchString tableView:tableView atIndexPath:indexPath];
}
- (CGFloat)heightForCellForMentionsEntity:(id<HKWMentionsEntityProtocol>)entity
Expand Down

0 comments on commit 76185ae

Please sign in to comment.