Hi, I am working on the IOS application, related to voice over, my Question is : When accessibility voice over was enabled how can i get the swipe gestures left, right, top and down, what are the function for detecting these in swift?
Hi, I am working on the IOS application, related to voice over, my Question is : When accessibility voice over was enabled how can i get the single gestures left, right, top and down, what are the function for detecting these in swift?
You should have a look here (if not done yet):
h ttps://www.apple.com/voiceover/info/guide/_1137.html
To assign commands to gestures:
When VoiceOver is on, open VoiceOver Utility by pressing VO-F8.
Click the Commanders category, click Trackpad, and make sure the Enable Trackpad Commander checkbox is selected.
Click Assign Commands.
From the pop-up menu, choose the modifier key to use with gestures. By default, Command is used.
Unlike standard VoiceOver gestures, you must hold down a modifier key to use customized gestures.
Interact with the Trackpad Gesture Commands table and navigate down the gesture column until you hear the gesture you want to assign a command to.
Interacting with content areas
Move to the Command column, open the pop-up menu of commands, and then use the arrow keys to navigate the available commands.
A screen shot of the Trackpad Commander. The VoiceOver Utility window, divided vertically into two parts. A sidebar on the left lists categories, preceded by an icon, and an area on the right shows options for the currently selected category. Commanders is the current category in the sidebar. On the right is displayed the Trackpad Commander pane for assigning commands to gestures.¶¶At the top right of the pane is the text \“Select a modifier key, then assign a command to a gesture. Built-in VoiceOver gestures cannot be changed.\” To the right of the text is the Modifier pop-up menu where Command is selected. Below the text and pop-up menu is a table with two columns, from left to right: Trackpad Gesture, Command. The fourth row is selected and contains Command Flick Up in the Trackpad Gesture column and on the right is a pop-up menu of command categories for assigning a command to the gesture. The command categories from top to bottom are: General, Information, Navigation, Text, Web, Find, Tables, Size and Position, Audio, Braille, Visuals, Hot spots, Jump, Custom Commands. To the right of each category name is an arrow for displaying the commands in each category.
When you hear the command you want to assign to the current gesture, press Return to select it.
When you’re finished assigning commands, click Done.
You can use the Custom Commands menu to assign scripts and Automator workflows to gestures. For example, you could run a script (such as a Perl, Ruby, Python, or AppleScript script) when you use the gesture Command-Two-finger Double-tap.
Thanks for replaying, i have gone through the link which you shared
what i was understtod is: In the voice over utility, where we can give commands to the gestures which is left, right, top and down.
But what i required was: i need the control of those gestures in my apllication programatically to detect those functions?
Could you elaborate a bit more the use case and what you mean by "detect those functions":
i need the control of those gestures in my apllication programatically to detect those functions
Yes Sure, We used to display some data in the UiTableView, We would like to capture the mono swipe(left, right, top and down) gestures programatically in Swift when the voice over is on. So that if there is no gestures for more than 15 seconds, We used to clear the UiTableView and display the new set of data. We are able to capture only three finger gestures( left, righ, top, down) programatically but failing to capture the mono swipe gestures using the framework APIs. Is there a possibilities to keep track of the mono swipe gestures?
Thanks in Advance.
I would try this way:
declare
var lastSwipeTime : Double = 0.0 // Will keep track of elapsed time
var needToClear = false
When the view is loaded, lastSwipeTime is set to current time
In a user thread, permanently check needToClear;
Store time elapsed in elapsedSinceLastSwipe
needToClear = (present time - lastSwipeTime) > 15.0 // take care to have the right unit in seconds
if true, call a func to reload the tableView, and reset needToClear to false and lastSwipeTime to current time
In the IBAction for swipes, reset lastSwipeTime
lastSwipeTime = present time
Hope that helps.
Thanks for replaying
IBAction for swipes UISwipeGestureRecognizer it gets called when voiceover state is turned off and swiping the UITableView.
But when the voiceover state is turned on and swiping the UITableView, we are not able to identify the callback function from framework API's.
Could you please help to track those callback functions?
Our development is for Ios Mobile application.
It seems you have to set the accessibility traits for the view (Identity inspector in IB) to allow direct interaction (and probably update frequently): set the checkboxes.
There are in fact 2 traits related to VoiceOver : h ttps://developer.apple.com/documentation/uikit/accessibility/uiaccessibility/accessibility_traits
var UIAccessibilityTraitAllowsDirectInteraction: UIAccessibilityTraits
The accessibility element allows direct touch interaction for VoiceOver users.
var UIAccessibilityTraitCausesPageTurn: UIAccessibilityTraits
The accessibility element should cause an automatic page turn when VoiceOver finishes reading the text within it.
Get more details here:
h ttps://stackoverflow.com/questions/42240227/registering-uigesturerecognizer-actions-in-voice-over
UIAccessibilityTraitAllowsDirectInteraction: UIAccessibilityTraits, this initialization have already done but did not seems like its working
I have the UITableView, the tableview has items, when the voiceover state is turned on at particular item was selected in UITableView, after awards when am doing top and down swipe of UITableview the selected item was voicing with characters, how to detect those top and down callbacks programatically in swift?
And, one more thing i would like to ask when UITableView is present in activity will the IBAction for swipes UISwipeGestureRecognizer (top and down swipe) will work?
And for three finger swipe gestures was working with below code:
override func accessibilityScroll(_ direction: UIAccessibilityScrollDirection) -> Bool {
if direction == UIAccessibilityScrollDirection.down {
print("Direction Down")
}
else if direction == UIAccessibilityScrollDirection.up {
print("Direction up")
}
return true
}
So, like the above three fingers guestures code, whether we have any callback function for mono single swipe top, down gestures?
I've never used voice over, so I'm not quite sure.
Did you set the traits as well for the tableview cells ?
I've just found this in UIKit doc:
UIAccessibilityCustomAction
A custom action to be performed on an accessible object.
Overview
Apps that support custom actions can create instances of this class, specifying the user-readable name of the action and the object and selector to use when performing the action. Assistive technologies display custom actions in response to specific user cues. For example, VoiceOver lets users access actions quickly using the Actions rotor.
After creating an instance of this class, add it to the accessibilityCustomActions property of an appropriate accessible object.
Hi, i have set the traits to UITableViewCell like this
tableViewCell.accessibilityTraits = UIAccessibilityTraitAllowsDirectInteraction | UIAccessibilityTraitUpdatesFrequently
even though it seems not responding, i have made all intialization programatically regarding on voice over accessibility, But i did not find any solution to acheive my issue.
My issue is: Required the top and down swipe gesture programatically in swift when voiceover state is on, kindly request you to help me out of this?
Let's start again.
You want to detect that there was a swipe in the table view ? Right ?
Could you use
var indexPathsForVisibleRows: [IndexPath]?
To know if visibleCells have changed ?
Or could you overwrite the delegate function :
func tableView(UITableView, willDisplay: UITableViewCell, forRowAt: IndexPath)
look at this for details:
h ttps://stackoverflow.com/questions/32268856/how-to-know-that-tableview-started-scrolling
Hi, I have already used the above functions which is releated to UITableView.
I have implmented the function for swipe gestures (left, right, top & down) on the UITableView.
When the Voiceover was enabled, this time the swipe gestures are not working on UITableView, I hope so because the voiceover is controlling the whole UiTableView,
So, Our motto is we have any callbacks for swipe gestures on UITableView when Voiceover was enabled?
The detection of swipe gesture seem hidden by the scroll.
If you disable the tableView scrolling, that should probably work, but it is not a good solution.
I have not the answer to your motto question.