ignore
Any child accessibility elements become hidden.
Declaration
static let ignore: AccessibilityChildBehaviorDiscussion
Use this behavior when you want a view represented by a single accessibility element. The new accessibility element has no initial properties. So you will need to use other accessibility modifiers, such as accessibilityLabel(_:), to begin making it accessible.
var body: some View {
VStack {
Button("Previous Page", action: goBack)
Text("\(pageNumber)")
Button("Next Page", action: goForward)
}
.accessibilityElement(children: .ignore)
.accessibilityValue("Page \(pageNumber) of \(pages.count)")
.accessibilityAdjustableAction { action in
if action == .increment {
goForward()
} else {
goBack()
}
}
}Before using the ignorebehavior, consider using the combine behavior.