Skip to content

Commit 0dca5ba

Browse files
author
Justin Martin
committed
Tweak pullToRefresh to be more realistic
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
1 parent 424ed5f commit 0dca5ba

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/KIF/Classes/KIFUITestActor.m

+2-1
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,8 @@ - (void)pullToRefreshAccessibilityElement:(UIAccessibilityElement *)element inVi
13351335
// Can handle only the touchable space.
13361336
CGRect elementFrame = [viewToSwipe convertRect:viewToSwipe.bounds toView:[UIApplication sharedApplication].keyWindow.rootViewController.view];
13371337
CGPoint swipeStart = CGPointCenteredInRect(elementFrame);
1338-
CGPoint swipeDisplacement = CGPointMake(CGRectGetMidX(elementFrame), CGRectGetMaxY(elementFrame));
1338+
swipeStart.y = swipeStart.y - CGRectGetMaxY(elementFrame) / 4.0;
1339+
CGPoint swipeDisplacement = CGPointMake(0, CGRectGetMaxY(elementFrame) / 2.0);
13391340

13401341
[viewToSwipe dragFromPoint:swipeStart displacement:swipeDisplacement steps:kNumberOfPointsInSwipePath];
13411342
}

0 commit comments

Comments
 (0)