Skip to content

Commit

Permalink
Merge pull request #1141 from zradke/zradke/scroll-once
Browse files Browse the repository at this point in the history
Scroll once when waiting for UITableViewCells
  • Loading branch information
justinseanmartin authored Mar 19, 2020
2 parents 54c099f + 398c69b commit ecfc02d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Classes/KIFUITestActor.m
Original file line number Diff line number Diff line change
Expand Up @@ -1251,10 +1251,13 @@ - (UITableViewCell *)waitForCellAtIndexPath:(NSIndexPath *)indexPath inTableView
return KIFTestStepResultSuccess;
}];

[tableView scrollToRowAtIndexPath:indexPath
atScrollPosition:position
animated:[[self class] testActorAnimationsEnabled]];

__block UITableViewCell *cell = nil;
__block CGFloat lastYOffset = CGFLOAT_MAX;
[self runBlock:^KIFTestStepResult(NSError **error) {
[tableView scrollToRowAtIndexPath:indexPath atScrollPosition:position animated:[[self class] testActorAnimationsEnabled]];
cell = [tableView cellForRowAtIndexPath:indexPath];
KIFTestWaitCondition(!!cell, error, @"Table view cell at index path %@ not found", indexPath);

Expand Down

0 comments on commit ecfc02d

Please sign in to comment.