Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soutaro/virtualgesture
Cheat UIGestureRecognizer for testing
https://github.com/soutaro/virtualgesture
Last synced: 22 days ago
JSON representation
Cheat UIGestureRecognizer for testing
- Host: GitHub
- URL: https://github.com/soutaro/virtualgesture
- Owner: soutaro
- Created: 2012-05-01T14:49:18.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-05-10T08:51:16.000Z (over 12 years ago)
- Last Synced: 2024-05-01T23:28:47.042Z (6 months ago)
- Language: Objective-C
- Size: 198 KB
- Stars: 9
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# VirtualGesture
iOS gestures are source of headache for programmers. From the point of
view of automated integration testing, they are evil since it is
difficult to simulate from programs.VirtualGesture simulate gestures by directoly invoking actions
associated with UIGestureRecognizers. If you are using built-in
gesture recognizers -- UISwipeGestureRecognizer,
UILongPressGestureRecognizer, etc --, you can use VirtualGesture to
simulate user's multi touch gestures.## Example
// Long press gesture
[view recognizeLongPress];
// Swipe gesture
[view recognizeSwipe:UISwipeGestureRecognizerDirectionRight];
// Pinch gesture
[view recognizePinch:0.2];## Pros
* Simple API. Instead of configureing every touches of every frame and
every fingers, just say *swipe* or something like that.
* Timing matters. Some gesture recognizers have `velocity` property.
It is difficult to set up such *time dependent properties* by
sending touch events directory. VirtualGesture can do that. It just
setup gesture recognizer's properties, and invoke an action
associated with it.## Cons
* Not simulating user input.
* Customized gesture recognizers are not supported. For example,
UIWebView and MKMapView do not respond to virtual pinch gestures.
They do not use UIPinchGestureRecognizer but a customized, private
gesture recognizer.
* It is not clear, whether it works or not for complex usage of
multiple gesture recognizers.# Author
Written by Soutaro Matsumoto. (matsumoto at soutaro dot com)
Released under the MIT License: www.opensource.org/licenses/mit-license.php
github.com/soutaro/VirtualGesture