---
title: "accessibilityIdentifier(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/accessibilityidentifier(_:)"
---

# accessibilityIdentifier(_:)

Uses the string you specify to identify the view.

## Declaration

```swift
nonisolated func accessibilityIdentifier(_ identifier: String) -> ModifiedContent<Self, AccessibilityAttachmentModifier>
```

## Discussion

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

## See Also

### Identifying elements

- [accessibilityIdentifier(_:isEnabled:)](swiftui/view/accessibilityidentifier(_:isenabled:).md)
