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

# accessibilityIdentifier(_:isEnabled:)

Uses the string you specify to identify the view.

## Declaration

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

## Parameters

- `identifier`: The accessibility identifier to apply.
- `isEnabled`: If true the accessibility identifier is applied; otherwise the accessibility identifier is unchanged.

## Discussion

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

## See Also

### Identifying elements

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