How can I disable gestures in the ios simulator? - ios

I am trying to test out my site using the ios simulator and I don't want the default double-tap gesture to work when the user double-clicks, since it is interfering with my site.
Is there any way to disable the double-tap gesture either in the simulator or in the code?

I don't think it's possible to disable just the double tap gesture, and it may not be possible to disable at all.
The relavant references are the Safari Web Content Guide and the GestureEvent Class Reference. The first says that double tap doesn't produce a gesture event. It's possible that suppressing lower level touch events will cause the double tap not to be recognized, but that will also cause other gestures not to be recognized, which it sounds like you don't want. There are other things you can do as well such as restricting the zoom range for the site, but they all have other side effects that you may not want

I have not tried this, but see if you can add a doubleTap GestureRecognizer to your webView and do nothing in the target function.
On a side note, if your website is meant to be viewed on mobile devices, it would be advisable to leave alone the double tap gesture, as it is the standard way of zooming.

Related

Is it possible to perform a custom multi-touch gesture in an Xcode UI Test?

I'm trying to test the behavior of an iOS app as it responds to complex multi-touch gestures.
The only multi-touch testing capability I've been able to find are two convenience methods on XCUIElement: pinch(withScale:velocity:) and rotate(_:withVelocity:). However, this is not powerful enough for my needs. (Also, the rotate gesture does not work consistently.)
In an Xcode UI test, is there a way to customize the paths of each touch in a multi-touch gesture? Something similar to how XCUICoordinate allows you to customize the path of a press-and-drag gesture?

How can I prevent multitouch in Xamarin Forms (specifically iOS project)?

We have a project with a chat page. In this page, when the user simultaneously taps the text entry box and outside of the box, we have undesired behavior. The text entry box moves to make room for the keyboard but the keyboard does not display. We have an Android and iOS project, but this only occurs in the iOS side.
I believe disabling multitouch would be a good option here because we do not use any multitouch gestures. However, I cannot find any information about how to successfully accomplish this. I have read about doing something like TouchesBegan, but it did not work for me.
You can't disable multitouch throughout your app as the iOS SDK just does not allow this.
You could use ExclusiveTouch on a view to block touch events from other views while this one is receiving a touch event.

Disabling the 3D Touch Task Switcher Gesture on the Left Edge of the Screen

If you press firmly on the left edge of the screen using an iPhone with 3D touch you will bring up the task switcher.
I'd like to know how I can disable this behavior in my app.
There is no API for that, just as there isn’t one for disabling any other way of getting out of your app. If you’d like such a thing, you can file an enhancement request with a description of what you’re trying to do.
While there isn't an API for this, it appears that the behavior is constrained to Portrait mode. If you run Apple's TouchCanvas example, you'll see that the gesture doesn't actually work because the app runs in Landscape mode. If you modify the project to support both Portrait and Landscape, you can see the gesture is enabled in Portrait, and disabled in Landscape.
So, that may be a suitable workaround, depending on your use case.
I've filed a Radar for this at https://bugreport.apple.com, suggesting that Apple offers an API similar to being able to set:
self.navigationController?.interactivePopGestureRecognizer.enabled = false
and would suggest that you do the same if seeing the feature is of interest to you. They'll probably close duplicates, but voicing more support couldn't hurt.

iOS : Swipe gesture not getting recognized when swipe begins from outside the iPad screen

Recently I found a weird iPad behavior on touches. I have a UITableView that slides in from the right edge of the screen(Like Facebook app has it on the left side) on swipe. In my implementation I have added a strip of UIView and have added swipe gesture recognizer. My application is in Landscape mode only
Now since the view comes out from the right edge, the general behavior would be to start swiping the finger from outside the edge of the screen. The menu shows up perfectly all the time, if the swiped finger starts from the edge that has the home button. However in landscape right mode i.e when the camera edge is on the right, and I swipe from that end, the gesture gets recognized once in 3-4 attempts.
I implemented touchesBegan method in the same class and got exactly the same behavior.
Does my application fails to identify touches from that edge(that to selectively)? What exactly it is happening? looks like it is a deadlock on Coding front.
Please help.
Thanks
Since you want the touch to begin from the edge of the screen, why not use UIScreenEdgePanGestureRecognizer? This class is specifically used for touches that begin near the edge of the screen.
There is a simple example here.
Is your app is full-screen? if so than the ios system is trying to pull down the SB-settings from that side
I'm seeing the exact same thing. And I do use UIScreenEdgePanGestureRecognizer, I even apply the recognizer to the whole screen view.
Also, I see the same behavior in "portrait-upside-down" orientation.
I think it's a bug in the touch recognition in iOS 7 and 8 (actually until I saw this post I thought it's the gesture recognition but that doesn't explain the same behavior for generic touch handling).

Is there any way to create a custom VoiceOver gesture?

Is there any way to create a custom gesture in iOS specifically for VoiceOver users?
Thank you
I think this MIGHT be possible. The iOS Mail app (at least in iOS 6) seems to contain custom Voiceover actions (you can swipe up or down to enable a "delete" operation on a mail item in the list).
My guess is (and I haven't verified this, is that if you add a swipe recogonizer only when UIAccessibilityIsVoiceOverRunning() returns true.
I haven't tested this yet.
I'm almost certain that this is not possible. That said, the accessibility APIs allow you to do things like speak content when a view changes, so maybe you could use this?
You mentioned a gesture specifically for Voiceover users - if Voiceover users are the majority of your audience, then you could just provide a standard gesture, which Voiceover users could invoke by double tapping and holding to pass the gesture through, and then performing the gesture itself.
For example, to "pull to refresh" a Voiceover user would double tap, hold, then pull down.

Resources