I have to detect functional HOME buttons and LOCK screen buttons which I have been able to do
But the issue is user can emulate these buttons' behaviour if assistive touch is on. So is there a way in IOS to detect if user has Assistive Touch turned on so that app can ask them to turn it off before moving on.
Apple hasn't provided any official APIs for that either accessing the existing Assistive Touch feature.
Related
Apple's recent iPhone XR announcement replaces 3D Touch with Haptic Touch, letting you access 3D Touch features by just long-pressing a view.
I'm curious how that will interact with existing UILongPressGestureRecognizer interfaces. There are items in my app that currently have different 3D Touch and long-press functionality.
Since the iPhone XR hardware isn't yet available, I was wondering if anything had been published about how the two features will work together.
Based on testing in the simulator using the Hardware | Touch Pressure | Use Trackpad Force option, Haptic Touch is just a long press.
"In 2015, when the iPhone 6S and 6S Plus were announced, Apple also introduced 3D Touch. 3D Touch uses a Taptic Engine with haptic feedback, which allows the device to sense the pressure of a touch, thereby triggering specific actions. For example, pressing hard on an icon will enable us to quickly open an action menu." - Clayton, C. (January 2018). Learn iOS 11 Programming with Swift 4 - Second Edition.
"3D Touch is basically a technology that adds another dimension (hence the name) to the tapping mechanism that you find in every iOS device. Traditionally, a user could perform the following actions on an iOS device’s screen using her fingers:
Tap;
Long tap;
Swipe;
Double tap.
With the availability of 3D Touch on a device, a new vector that registers the strength of a touch on the screen is added to the formula, allowing the user to keep her finger on the screen and apply more pressure until an action (application specified) is performed. 3D Touch simply allows the iOS device to have access to how hard the user is pressing her finger on the screen, and this opens the door for a whole new set of applications." - Nahavandipoor, V. (2017). iOS 11 Swift Programming Cookbook.
"3D Touch works because the iPhone’s screen is pressure sensitive. You can press on the display, and the harder you press the more “happens.” Haptic Touch screens, like on the iPhone XR, don’t have this pressure sensitivity. Instead, Haptic Touch appears to be just a new name for our old friend, the long press.
(...)
seems like Haptic Touch can do most of what 3D Touch does already. In iOS 12, a new trackpad mode was added, one that works with every iPhone and iPad. Trackpad mode lets you press hard to turn the iPhone’s keyboard into a trackpad, which in turn lets you control the cursor in the text above. The new mode lets you do the same by long-pressing the keyboard’s space bar. I’m almost certain that this feature will get a Haptic Touch vibration in the iPhone XR." - Sorrel,C. (September 2018). What’s the difference between 3-D Touch and Haptic Touch?
"It’s important to remember that not all devices have a Taptic Engine; in the devices that don’t, the feedback simply won’t be played. This means that you mustn’t rely on tactile feedback (...) it should be used to underline effects that are already visually or aurally present." - Buttfield-Addison, P., Manning, J. (October 2018). iOS Swift Game Development Cookbook, 3rd Edition.
"Considering they removed 3D Touch from the device to cut manufacturing costs and to give us the new "Liquid Retina" display, we don't expect any real pressure sensitivity to be associated with Haptic Touch." - Peterson, J. (September 2018). All the 3D Touch Actions You'll Lose by Switching to the iPhone XR with 'Haptic Touch'.
At this stage it’s somewhat unclear how many of the functions supported by Apple and 3rd party apps on 3D Touch can and/or will be supported on Haptic Touch.
With this, what's happening now with 3D touch seems similar to what happened with Force touch back in 2015. The Haptic touch meaning is more specific describing the set of possible actions (as 3D touch has broader meaning). As mentioned by Buttfield-Addison, P., Manning, J., i wouldn't depend on this type of feedback. Since you have it in your app already and basing myself on the meaning of haptic (relating to the sense of touch, in particular relating to the perception and manipulation of objects using the senses of touch and proprioception), I reckon the long-press will remain as it's one of the possible touch interactions in the set of a normal / mainstream person's actions.
There's a good answer in apple.stackexchange I suggest you to read.
I want to enable Peek&Pop, and include 3D Touch actions for iPhone 6s & up users, however I also want to enable a long press to enter non-3D Touch users into the Action sheet.
I understand how to use the peek and pop delegate methods, and I understand how to create a long press gesture. What I need to know is how to connect the long press action to display the peek preview with actions showing.
From all that I can find online and in documentation, I now believe that Apple does not allow you to show the 3D Touch UI on non-3D Touch devices. While the other answer here is a decent alternative (implementing a long press to do an action on non-3D Touch), there is no current answer to my original question.
I am building an app which will be displayed on an iPad. It will be an app for customers in the shop who will be able to leave their contact data. I am going to put an iPad to a frame so they won't be able to press home, lock buttons. Just the screen.
My question is: is there any way to prevent them from closing my app by a gesture? (fingers going closer to each other) or a gesture of switching apps? (3 fingers swipe left/right)
I suppose I can set it in settings, but I really need it to be set in the code.
Does iOS system provides that feature (disabling system gestures programically?)
Thank you
Is there a way to suppress gesture recognition? What inspires me to ask this question is watching my grand-daughter, who is a toddler, using an iPad. Quite often, she will accidentally invoke a gesture recognizer that switches apps. An example of this would be the four finger gesture where you can slide an app out of the way.
For a "child proof" app, is it possible to suppress these? Failing that, is it possible to suppress switching to another app? At first thought, that seems out of scope of an app, but maybe there is a way to do it.
You don't need to do it in your app, because it is an accessibility feature of iOS 6. It is called "Guided Access" and you can enable it in Settings -> General -> Accessibility in the Learning section.
I had the same requirement, but you cannot override the gesture recognition. It takes priority over your app.
Actually I wanted to do an app for my baby and had the same requirement!, but you cannot disable the gesture recognition on a non jail broken device ;(
No, but you can turn off it in settings manually. Go to settings> general> Multitasking gestures. I dont think we can control this via coding for normal apps, but you can inform the user to disable it here through an alert before using the app. That is the most appropriate way available now.
I am developing a game where the user could draw using up to 5 fingers, 1 finger for each line.
When multitask gesture is enabled and the user try to draw using more than 4 fingers from right to left, the gesture recognizer from iOS on iPad switch to another application.
How can I programmatically disable this recognizer when the user enters on my application?
There is no API for that.
There might be a way to consume the gesture, so it is not forwarded to the system, but I think the order of the messaging chain is in the other way.
You can only ask your users to disable the Multitasking Gestures in the System Preferences, under the General section. Not really great, I know.