accessibilityCustomContent

Add additional accessibility information to the view.

View ModifieriOS 16.0+macOS 13.0+tvOS 16.0+watchOS 9.0+

Overloads

3 ways to call compose().accessibilityCustomContent(). Each is one SwiftUI overload, picked by the arguments you pass.

React
compose().accessibilityCustomContent(
  label: string,
  value: string
)
Swift
@export(implementation) nonisolated func accessibilityCustomContent(
    _ label: LocalizedStringResource,
    _ value: Text,
    importance: AXCustomContent.Importance = .default
) -> ModifiedContent<Self, AccessibilityAttachmentModifier>
6 more Swift overloads share this form
Swift
@export(implementation) nonisolated func accessibilityCustomContent(
    _ label: LocalizedStringResource,
    _ valueResource: LocalizedStringResource,
    importance: AXCustomContent.Importance = .default
) -> ModifiedContent<Self, AccessibilityAttachmentModifier>
Swift
@export(implementation) nonisolated func accessibilityCustomContent<V>(
    _ label: LocalizedStringResource,
    _ value: V,
    importance: AXCustomContent.Importance = .default
) -> ModifiedContent<Self, AccessibilityAttachmentModifier>
where V : StringProtocol
Swift
nonisolated func accessibilityCustomContent(
    _ labelKey: LocalizedStringKey,
    _ value: Text,
    importance: AXCustomContent.Importance = .default
) -> ModifiedContent<Self, AccessibilityAttachmentModifier>
Swift
nonisolated func accessibilityCustomContent(
    _ labelKey: LocalizedStringKey,
    _ valueKey: LocalizedStringKey,
    importance: AXCustomContent.Importance = .default
) -> ModifiedContent<Self, AccessibilityAttachmentModifier>
Swift
nonisolated func accessibilityCustomContent<V>(
    _ labelKey: LocalizedStringKey,
    _ value: V,
    importance: AXCustomContent.Importance = .default
) -> ModifiedContent<Self, AccessibilityAttachmentModifier>
where V : StringProtocol
Swift
nonisolated func accessibilityCustomContent(
    _ label: Text,
    _ value: Text,
    importance: AXCustomContent.Importance = .default
) -> ModifiedContent<Self, AccessibilityAttachmentModifier>

Parameters

  • label*string

    Localized text describing to the user what is contained in this additional information entry. For example: "orientation".

  • value*string

    Text resource for the additional accessibility information. For example: "landscape."

Discussion

Use this method to add information you want accessibility users to be able to access about this element, beyond the basics of label, value, and hint. For example: accessibilityCustomContent can be used to add information about the orientation of a photograph, or the number of people found in the picture.

See also

More in Accessibility.