accessibilityIdentifier

Uses the string you specify to identify the view.

View ModifieriOS 14.0+macOS 11.0+tvOS 14.0+watchOS 7.0+

Overloads

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

React
compose().accessibilityIdentifier(identifier: string)
Swift
nonisolated func accessibilityIdentifier(
    _ identifier: String
) -> ModifiedContent<Self, AccessibilityAttachmentModifier>

Parameters

  • identifier*string

Discussion

Use this value for testing. It isn't visible to the user.

See also

More in Accessibility.