Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ios simulator: simulate swipe and drag

I have a UIView within a UIScrollView. When i want to simulate the drag event on the UIView, swipe event on the UIScrollView is being triggered.

As per the documentation , there isn't much of a difference between swipe and drag.
Swipe

1- Place the pointer at the start position.  
2- Hold the mouse button. 
3- Move the pointer in the swipe direction and release the mouse button.


Drag

1- Place the pointer at the start position.
2- Hold down the mouse button.
3- Move the pointer in the drag direction.

On an ipad I can use two fingers two swipe and one finger to drag. Now, how do i go about doing something similar on the simulator; drag instead of a swipe?

Edit 1: I should have been clearer first up. Anyway, my problem is that the mouse drag is firing the swipe instead of drag, thereby scrolling the scroll view instead of passing on the drag event to the UIView contained by the scroll view. I am on macbook pro. Two-finger swipe on the touchpad is being ignored. Touch and drag is causing the same thing as mouse-drag. Thanks

like image 577
Srisa Avatar asked Sep 09 '11 12:09

Srisa


People also ask

Which key is used to emulate gesture iOS simulator?

Holding the "Alt/Option" key and dragging simulates multi-touch pinch-to-zoom. Holding "Alt/Option + Shift" and dragging simulates multi-touch scrolling.

Does iOS simulator simulate performance?

The simulator does a really lousy job of indicating app performance. In fact it doesn't try. For most things the simulator is much, much faster than an iOS device. It runs your code on an x86 processor, which is much faster than the ARM and has many times more memory.

How do you scroll on iPhone simulator?

You can click the trackpad and drag (as other folks have said), or if you have "Three finger drag" enabled in Trackpad preferences, you can scroll with three fingers. Show activity on this post. You need to click and hold to scroll.

Can you run iOS simulator without Xcode?

Well, that's not entirely true, you can actually still directly launch iOS Simulator without opening Xcode first by creating an alias. Note that modern versions of Xcode and OS X call the iOS Simulator simply “Simulator”, where you go will depend on which version of OS X the Mac is running.


1 Answers

See Jeff LaMarche's quick note on how to do this. It's documented in the same page you're reading, but Jeff's explanation is clearer.

If you want to simulate a two-finger gesture in the iPhone simulator, hold down the option key. You will get two dots on the screen instead of one. The two dots will default to pinching - if you bring the dot closer to the center of the screen, the other dot comes toward the center, making it easy to simulate a pinch in or pinch out.

If you want to do a different two-finger gesture, get the two dots the distance apart that you want them to be, then hold down the shift key, while still holding down the option key. That will lock the position of the two finger presses together so you can do, for example, a two-finger swipe.

like image 159
Rob Napier Avatar answered Sep 21 '22 14:09

Rob Napier