Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><s>There is simply no API for supplying custom element actions to VoiceOver. No <code>UIAccessibility*</code> protocol provides anything for this to be possible. I guess you should file a radar if you need to add custom actions and hope Apple will implement it in some future version of iOS (or that it will appear in iOS 7 in a month).</s></p> <p><strong>UPDATE</strong>: As of iOS 8, you can set/implement the <a href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIAccessibilityAction_Protocol/#//apple_ref/occ/instp/NSObject/accessibilityCustomActions" rel="noreferrer"><code>accessibilityCustomActions</code></a> property to return an array of your <a href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIAccessibilityCustomAction_class/index.html" rel="noreferrer"><code>UIAccessibilityCustomAction</code></a> objects (note that VoiceOver will still add the "Activate Item" default action in its UI in addition to what you provide.):</p> <pre><code>self.accessibilityCustomActions = [ UIAccessibilityCustomAction(name: NSLocalizedString("Close", comment: ""), target: self, selector: "didPressClose") ] ... @objc func didPressClose() -&gt; Bool { ... } </code></pre> <p>As usual with Swift and selectors, don't forget to add the <a href="https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/InteractingWithObjective-CAPIs.html#//apple_ref/doc/uid/TP40014216-CH4-XID_37" rel="noreferrer"><code>@objc</code></a> attribute to the target method of the custom action in Swift if you don't subclass <code>NSObject</code>/the method is private, otherwise on attempting to activate the action with VoiceOver, it will not do anything and play the "end of bounds reached" sound (at least on iOS 8.2 and 8.3 where I tested with target object that did subclass <code>NSObject</code>).</p> <p>Regarding your second question - feels like a bug which you can again file a radar for :-)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload