Ios 在使用Xcode7的UITest中使用“-[XUIElement SwipedDown]”时,如何设置滑动距离

Ios 在使用Xcode7的UITest中使用“-[XUIElement SwipedDown]”时,如何设置滑动距离,ios,objective-c,xcode-ui-testing,Ios,Objective C,Xcode Ui Testing,xguielement.h类文件显示 -voidscrollByDeltaX:CGFloatdeltaX deltaY:CGFloatdeltaY;和 -XCUICoordinate*坐标与规格化偏移:cgVector规格化偏移;功能。但这些不能在iOS设备上使用。h提供-voidswipeDown来滑动tableview。因为向下滑动的距离不够,所以像MJRefresh一样拉动刷新框架无法响应。 那么,如何自定义位置或使用exist函数编辑向下滑动距离 您可以下拉到坐标API以执行拉入刷新 l

xguielement.h类文件显示 -voidscrollByDeltaX:CGFloatdeltaX deltaY:CGFloatdeltaY;和 -XCUICoordinate*坐标与规格化偏移:cgVector规格化偏移;功能。但这些不能在iOS设备上使用。h提供-voidswipeDown来滑动tableview。因为向下滑动的距离不够,所以像MJRefresh一样拉动刷新框架无法响应。
那么,如何自定义位置或使用exist函数编辑向下滑动距离

您可以下拉到坐标API以执行拉入刷新

let firstCell = app.staticTexts["Cell One"]
let start = firstCell.coordinateWithNormalizedOffset(CGVectorMake(0, 0))
let finish = firstCell.coordinateWithNormalizedOffset(CGVectorMake(0, 6))
start.pressForDuration(0, thenDragToCoordinate: finish)

我在我的博客上放了一个。你可以下拉到坐标API来执行拉刷新

let firstCell = app.staticTexts["Cell One"]
let start = firstCell.coordinateWithNormalizedOffset(CGVectorMake(0, 0))
let finish = firstCell.coordinateWithNormalizedOffset(CGVectorMake(0, 6))
start.pressForDuration(0, thenDragToCoordinate: finish)

我已经在我的博客上放了一个卷轴。

滑动不是卷轴。它应该用于刷卡识别器,而不是滚动。因此,您无法更改距离。滚动是Apple UI自动化的老毛病之一,但see Swipe不是滚动。它应该用于刷卡识别器,而不是滚动。因此,您无法更改距离。滚动是苹果用户界面自动化的老毛病之一,但你看,虽然这确实有效,但滚动文件看起来并没有得到调整。在你的答案中有CGVectorMake0,6,但在我的应用程序中,它看起来只是滚动了1次,滚动太多了。是否有更多需要协调的标准化补偿?也许我只是不知道它是如何工作的。虽然它确实工作,但它看起来像是滚动它的文件,而不是调整。在你的答案中有CGVectorMake0,6,但在我的应用程序中,它看起来只是滚动了1次,滚动太多了。是否有更多需要协调的标准化补偿?也许我只是不知道它是怎么工作的。