AccessibilityContainer

public struct AccessibilityContainer : Element

Acts as an accessibility container for any accessible subviews.

Accessible subviews are found using the following algorithm:

Recurse subviews until a view is found that either

  • hasisAccessibilityElement set to true or

If an accessibility element is found, we add it to the accessibilityElements and terminate the search down that branch. If a container is found, the elements returned from the container are added to the accessibilityElements and the search down that branch is also terminated.

  • Declaration

    Swift

    public enum ContainerType
  • indicates the type of content in a data-based container.

    Declaration

    Swift

    public var containerType: ContainerType
  • An optional accessibilityIdentifier to give the container. Defaults to nil.

    Declaration

    Swift

    public var identifier: String?
  • An optional accessibilityLabel to give the container. Defaults to nil.

    Declaration

    Swift

    public var label: String?
  • An optional accessibilityValue to give the container. Defaults to nil.

    Declaration

    Swift

    public var value: String?
  • Declaration

    Swift

    public var wrapped: Element
  • Creates a new AccessibilityContainer wrapping the provided element.

    Declaration

    Swift

    public init(
        containerType: AccessibilityContainer.ContainerType = .none,
        label: String? = nil,
        value: String? = nil,
        identifier: String? = nil,
        wrapping element: Element
    )

Element