2 fingers touch UIWebview, make my app crash - ipad

UPDATE
I'm looking for the best way to detect more than one finger on a particular view at time in this case the view is UITextview. I'm not detecting taps or pinching, just the fact that more than one touch is happening. In this case, i set textview.multipleTouchEnabled=NO and then i didn't set gesture anywhere. And i didn't set the zoom in UITextView. And i didn't override some of touches method in that controller.
the problem is, when i touch my app on the device using a touch like pinching, or touch use more than one finger, the app got crashed and no error log in the debugger console. I try to debug this app, but i dont know what i'm looking for.
UPDATE 2
i was wrong about the object that get user touch, i was thought that the object is UITextview, but UIWebview. So, this problem is happen when i touch UIWebview with 2 fingers. I have forwarded the touches event using this suggestion. But i still confuse, how to clear up this crash on my app.
Can somebody help me??
Thank You
Regard,
Risma

Check that text view zoom level is set by default it's min and max zoom is 1.
In pinch gesture you have to set scale factor.

Related

Register multi-touch as a single touch?

Is there a way to register multi-touch as a single touch? Say if I use three fingers to tap a large button, can it be registered as simply one tap of the button? -- the current default appears to treat it as a multi-touch, and as a result ignores the button-pressing altogether. Similarly, if I use my palm to tap a large button, the button isn't pressed either.
I noticed in iphone Accessibility Settings -> Touch Accommodations, one could set "Ignore Repeat" and "Use Initial Touch Location" for tap assistance. Of course, if those are turned on, it affects the entire phone instead of just one app. But would that be the direction to approach this problem?
BTW I don't actually need multi-touch in my app. So if turning off multi-touch can be more simply done on the whole-app level instead of button-by-button, it would suit this case very well.
Thank you #DonMag for providing a hint.
So, if yours is an ios app from Capacitor, here is how to change your javascript code:
Change your button onClick events into "onTouchStart"
Use a state variable to keep track of whether "onTouchStart" is triggered and the resulting logic is executing. During that execution, prevent more touch events to have further effect on the button. This is to prevent the button from being pressed in quick succession by multiple touches that come from, say, your three-finger tap or palm tap. Only after the execution is finished do you revert the state variable back to the original value, so that the button is ready to be pressed again.
If there is an answer that's more suitable for the native Swift bundle I'll accept that as the answer. The above is just to help anyone who may encounter the same problem as mine.

Detect palm touching/releasing the iphone screen

Implementing a sort of 'distress call' button which should work as following:
User starts application and covers a screen with a palm of a hand
Some time passes, user may introduce additional touches during that time or remove some of the existing (but not all of them), location/shape of touches may change
When user releases a hand (i.e. removes last touch) a distress signal is emitted by the app
Basically, the app should register two events: (1) a screen is touched (2) all touched are released
I'm trying to use touchesBegan/touchesEnded methods and those work for small area touches (fingertips) but on touching screen with a full palm or even only palm edge a touchesCancelled gets triggered immediately while hand is still on the screen. Obviously no other events are emitted upon hand release afterwards.
I tried subclassing UIWindow and UIApplication and overriding sendEvent in those but got no additional info - large area touches are triggering touch begin and immediately touch cancel, releasing hand afterwards emits nothing. In some cases large area touches fire no events at all, not even the touchesBegan. Basically, iOS doesn't let me work with a very basic scenario - detecting just the fact of screen touch/release.
Is there any way to query the screen touch state directly and not work with responder chain? Or suppress the cancellation event from firing? Or maybe I'm missing something?
Unfortunately, as of right now, no solution exists

Is there a way to test if accessibility zoom is on?

I'd like to know if there is a line of code like isAccessibilityZoomOn to test if accessibility zoom is on. In a game I am working on, if you use zoom, the game glitches and a timer continuously goes, even though it shouldn't unless a finger is on the screen. I'm currently using the ccTouchesBegan method to start the timer, but if you have zoom on and use three fingers to tap the screen you can remove your fingers and the timer continues.
I don't believe Apple lets you access that kind of information. That is a strange effect, possibly caused by the tap to zoom in?

iOS: Detect if touchEnded comes from sliding off screen or lifting finger?

In iOS is there any way to tell, when the touch ends, if it ended by sliding off the screen or if the user lifted his finger?
I don't know why, but I expected the touch to be cancelled when this happened, but it is not.
Thanks.
This is standard iOS behavior, you may see it in any Apple's app.
You may check if touch ended at the end of screen and treat it as "cancel sliding", but user might be wanting to slide this far.
My advice is accept it, because, as I said before, it's standard behavior, and Apple tells us to stick to it - users expect standard behavior.
Only through deduction. If the finger was moving towards the edge of the screen and then the touch ends near that edge, you can be relatively certain that the finger indeed slid off the screen. If it wasn't moving immediately before the touch ended, the user probably just lifted their finger.

iOS Touches Began susequent touches only arrive if first touch moved

I'm overriding the touches methods in a UIView for a piano app.
If I touch with one finger the iPhone or iPad I get -as expected- the touchesBegan callabck. And if I touch with a second finger I get that event in the touchesMoved callback. This is all fine, BUT I get the second (and third etc) callback ONLY if the first finger moves while I touch with the second one.
For a piano app this is a problem since I need to be able to touch really quickly.
Does anybody know a workarround for this? Is there an alternative than using touchesBegan/Moved/Ended methods?
Did you enable multitouch (setMultipleTouchEnabled:YES) for that UIView?

Resources