diff --git a/BlueprintUILists/Sources/ListReorderGesture.swift b/BlueprintUILists/Sources/ListReorderGesture.swift index 667bc79a..a81f59ee 100644 --- a/BlueprintUILists/Sources/ListReorderGesture.swift +++ b/BlueprintUILists/Sources/ListReorderGesture.swift @@ -56,7 +56,7 @@ public struct ListReorderGesture : Element let actions : ReorderingActions /// The acccessibility Label of the item that will be reordered. - /// This will be set as the gesture's accessibilityValue to provide a richer VoiceOver utterance. + /// This will be used to provide a richer VoiceOver utterance useful for disambiguation as to which element will br reordered., public var reorderItemAccessibilityLabel : String? = nil /// Creates a new re-order gesture which wraps the provided element. @@ -171,8 +171,12 @@ fileprivate extension ListReorderGesture func apply(_ model: ListReorderGesture) { blueprintView.element = model.element - proxyElement.accessibilityLabel = ListableLocalizedStrings.ReorderGesture.accessibilityLabel - proxyElement.accessibilityValue = model.reorderItemAccessibilityLabel + if let itemName = model.reorderItemAccessibilityLabel { + proxyElement.accessibilityLabel = String(format: ListableLocalizedStrings.ReorderGesture.accessibilityLabelFormat, itemName) + } else { + proxyElement.accessibilityLabel = ListableLocalizedStrings.ReorderGesture.accessibilityLabel + } + proxyElement.accessibilityHint = ListableLocalizedStrings.ReorderGesture.accessibilityHint proxyElement.accessibilityTraits.formUnion(.button) proxyElement.accessibilityCustomActions = model.accessibilityActions() diff --git a/ListableUI/Sources/ListableLocalizedStrings.swift b/ListableUI/Sources/ListableLocalizedStrings.swift index dc1e67f1..53ec5b4d 100644 --- a/ListableUI/Sources/ListableLocalizedStrings.swift +++ b/ListableUI/Sources/ListableLocalizedStrings.swift @@ -19,6 +19,12 @@ public struct ListableLocalizedStrings { value: "Reorder", comment: "Accessibility label for the reorder control on an item") + public static let accessibilityLabelFormat = NSLocalizedString("reorder.AccessibilityLabel", + tableName: nil, + bundle: .listableUIResources, + value: "Reorder %@", + comment: "Accessibility label for a reorder control with a provided name" ) + public static let accessibilityHint = NSLocalizedString("reorder.AccessibilityHint", tableName: nil, bundle: .listableUIResources,