Just dragging from the top of the screen down to the bottom of the screen would do this, right? KIF has the following method implemented in the UIView-KIFAdditions category:
- (void)dragFromPoint:(CGPoint)startPoint toPoint:(CGPoint)endPoint;
I went further and created the following test step for simple drag and drop operations:
+ (id)stepToDragFromStartPoint:(CGPoint)startPoint toEndPoint:(CGPoint)endPoint { NSString *description = [NSString stringWithFormat:@"Simulate dragging finger from point %.1f,%.1f to point %.1f,%.1f", startPoint.x, startPoint.y, endPoint.x, endPoint.y]; return [KIFTestStep stepWithDescription:description executionBlock:^(KIFTestStep *step, NSError **error) { UIView *viewToSwipe = [UIApplication sharedApplication].keyWindow.subviews.lastObject; [viewToSwipe dragFromPoint:startPoint toPoint:endPoint]; return KIFTestStepResultSuccess; }]; }
Hope this helps!
source share