Skip to content

Commit

Permalink
Tweak pullToRefresh to be more realistic
Browse files Browse the repository at this point in the history
Have the pullToRefresh action pull from 25% of the way down the element to 75% of the way down, instead of pulling from the center and pulling a full height of the element
  • Loading branch information
Justin Martin committed Sep 19, 2024
1 parent 424ed5f commit 0dca5ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/KIF/Classes/KIFUITestActor.m
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,8 @@ - (void)pullToRefreshAccessibilityElement:(UIAccessibilityElement *)element inVi
// Can handle only the touchable space.
CGRect elementFrame = [viewToSwipe convertRect:viewToSwipe.bounds toView:[UIApplication sharedApplication].keyWindow.rootViewController.view];
CGPoint swipeStart = CGPointCenteredInRect(elementFrame);
CGPoint swipeDisplacement = CGPointMake(CGRectGetMidX(elementFrame), CGRectGetMaxY(elementFrame));
swipeStart.y = swipeStart.y - CGRectGetMaxY(elementFrame) / 4.0;
CGPoint swipeDisplacement = CGPointMake(0, CGRectGetMaxY(elementFrame) / 2.0);

[viewToSwipe dragFromPoint:swipeStart displacement:swipeDisplacement steps:kNumberOfPointsInSwipePath];
}
Expand Down

0 comments on commit 0dca5ba

Please sign in to comment.