Re: Accessibility For Table Edit Actions
Re: Accessibility For Table Edit Actions
- Subject: Re: Accessibility For Table Edit Actions
- From: Nick Nallick <email@hidden>
- Date: Fri, 25 Mar 2016 13:11:31 -0600
Okay, so upon further inspection the accessibilityCustomActions code is working correctly, I was just setting up the cell improperly. It’s still weird that with two substantially similar tables (using same UITableViewCell subclass) the cell’s edit actions are recognized on one but not the other.
The Swift code looks like this (inside UITableViewDataSource:cellForRowAtIndexPath):
cell.accessibilityCustomActions = [UIAccessibilityCustomAction(name:"Remove", target:self, selector:#selector(self.remove))]
It looks like the main drawback to using the accessibilityCustomActions rather than the table’s edit actions is that it’s not obvious which cell I’m working with since I don’t get a NSIndexPath as I do for the table edit action. Is there some way to work backward to that and figure out which table cell is selected? For example, it looks like UIAccessabilityFocusedElement returns a private object UITableTextAccessabilityElement with a reference to my table cell but I don’t know how to get the cell with public API.
I guess I could subclass UIAccessibilityCustomAction and add a reference to my table view cell, or make the cell the target and give it a reference to the table, but those seem like a hacks.
I’m testing on iOS 9.3 and Xcode 7.3.
Thanks,
Nick
> On Mar 25, 2016, at 11:20 AM, email@hidden wrote:
>
> What does your accessibilityCustomActions code look like?
>
> What version are you testing on?
>
>> On Mar 25, 2016, at 8:20 AM, Nick Nallick <email@hidden> wrote:
>>
>> I'm working on adding accessibility to a couple of table views and I've turned on voice-over to test it. The cells in both table views have custom edit actions, but they behave differently. In one, when I select a cell it reads the cell's label and then adds "actions available." If I then swipe down it reads the edit action and I can double tap to select it. This my desired behavior.
>>
>> In the other table it just reads the cell's label. If I swipe down it starts spelling the label letter by letter but there doesn't seem to be any way to access the edit action. I can't find any significant difference between the two sets of table cells. They both have similar contents and a single edit item (although the one that works is destructive and the other isn't).
>>
>> I've tried adding accessibilityCustomActions to the cells that just want to spell their label but these are ignored (as far as I can tell). Can anybody tell me how to expose the edit item in these cells?
>>
>> TIA,
>> Nick
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Accessibility-dev mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden