Drag/Swipe over a scroll view - the scroll view ends in invalid state
Very weird issue happening (iOS 6.1 Simulator). When I drag or swipe using the methods in UIView+PublicAutomation over a scroll view (or table view or web view), the scroll view correctly scrolls but never stops scrolling (scroll indicator stays visible and the view won't accept any taps).
I have experimented with the code inside UIAutomationBridge (number of points, gesture duration) and logged the UIEvent objects delivered to the app and everything seems to be fine with one exception - the latest events from the drag/swipe have view set to nil.
Maybe the problem is inside UI Automation framework.
Is this just in the 6.1 simulator, or in 6.0 too?
Cheers,
Pete
Typed on a little bitty keyboard
On Apr 25, 2013, at 2:53 PM, ondrejhanslik [email protected] wrote:
Very weird issue happening (iOS 6.1 Simulator). When I drag or swipe using the methods in UIView+PublicAutomation over a scroll view (or table view or web view), the scroll view correctly scrolls but never stops scrolling (scroll indicator stays visible and the view won't accept any taps).
I have experimented with the code inside UIAutomationBridge (number of points, gesture duration) and logged the UIEvent objects delivered to the app and everything seems to be fine with one exception - the latest events from the drag/swipe have view set to nil.
Maybe the problem is inside UI Automation framework.
— Reply to this email directly or view it on GitHub.
Reproduced on 6.1, 6.0, 5.1 ipad simulators. Doesn't happen everytime but happens almost everytime.
Currently I am using the scroll helper as a workaround but I don't like tampering with the content offset directly because I depend on the dragging delegate methods.
Would you be able to add a example failing test to the Controls app in the repo which demonstrates this issue so I can reproduce locally and look into a fix?
Cheers,
Pete
Typed on a little bitty keyboard
On Apr 26, 2013, at 2:44 AM, ondrejhanslik [email protected] wrote:
Reproduced on 6.1, 6.0, 5.1 ipad simulators. Doesn't happen everytime but happens almost everytime.
Currently I am using the scroll helper as a workaround but I don't like tampering with the content offset directly because I depend on the dragging delegate methods.
— Reply to this email directly or view it on GitHub.
Just tested.
frank updatefrank launchfrank consolefrankly_map("view:'UIScrollView' first", "swipeInDirection:", "up")orfrankly_map("view:'UIScrollView' first", "swipeInDirection:", "down")- It's easily seen because the scroll indicator doesn't hide but you can check by
frankly_map("view:'UIScrollView' first", "isDragging")
(it's possible you will have to repeat 4. several times)
I spent the last couple of days trying to understand this issue and I am sure that:
- All the events are correctly delivered
- The pan recognizer in the scroll view/table view correctly gets the touch up event and ends the gesture
I was able to reproduce the same error using UI Automation:
tableView.dragInsideWithOptions({startOffset:{x:0.5, y:0.5}, endOffset:{x:0.55, y:0.8}, duration:0.1});
However, with UI Automation the error appears with much lower probability (only once after many tests).
One interesting fact is that the events generated by dragInsideWithOptions are different from the events generated by UIAutomationBridge.
When UIAutomation gesture duration is set to 0.1, the interval between touch down and touch up events is actually 0.2 seconds.
When I tried to change SWIPE_DURATION in UIAutomationBridge to some bigger value, nothing happened. It's strange, but the gesture is always only 0.1 seconds long, and generates only 3 events.