ios - 使用 KIF 从屏幕边缘滑动(测试 UIScreenEdgePanGestureRecognizer)?
<p><p>到目前为止,我还无法在 KIF 中进行边缘滑动(特别是针对设备运行 KIF 测试)。有没有人解决这个问题?我错过了什么吗? </p>
<p>结果函数:</p>
<pre><code>func panInViewFromLeftScreenEdge() {
// Grab the menu & its frame.
let menuView = UIApplication.sharedApplication().keyWindow!.subviews.last!
let frame = menuView.bounds
// Simulate a drag from the left edge to the right edge.
let startPoint = CGPointMake(CGRectGetMinX(frame), CGRectGetMidY(frame))
let endPoint = CGPointMake(CGRectGetMaxX(frame), CGRectGetMidY(frame))
menuView.dragFromPoint(startPoint, toPoint: endPoint)
}
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>试试:</p>
<pre><code>let view = tester().waitForViewWithAccessibilityLabel("<The view controller on screen's view's accessibility label")
view.dragFromPoint(CGPoint(x: 1, y: 150), toPoint: CGPoint(x: 40, y: 150))")
</code></pre></p>
<p style="font-size: 20px;">关于ios - 使用 KIF 从屏幕边缘滑动(测试 UIScreenEdgePanGestureRecognizer)?,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/33874450/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/33874450/
</a>
</p>
页:
[1]