<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/AccessibilityRotorEntry/init(_:id:in:textRange:prepare:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI23AccessibilityRotorEntryV_2id2in9textRange7prepareACyxG10Foundation23LocalizedStringResourceV_xAA9NamespaceV2IDVSnySS5IndexVGSgyyctcfc::OverloadGroup"
  },
  "title" : "init(_:id:in:textRange:prepare:)"
}
-->

# init(_:id:in:textRange:prepare:)

Create a Rotor entry with a specific label, identifier and namespace,
and with an optional range.

```
@export(implementation) init(_ label: LocalizedStringResource, id: ID, in namespace: Namespace.ID, textRange: Range<String.Index>? = nil, prepare: @escaping () -> Void = {})
```

## Parameters

`label`

Localized string used to show this Rotor entry
to users.

`id`

Used to find the UI element associated with this
Rotor entry. This identifier and namespace should match a call to
`accessibilityRotorEntry(id:in)`.

`namespace`

Namespace for this identifier. Should match a call
to `accessibilityRotorEntry(id:in)`.

`textRange`

Optional range of text associated with this Rotor
entry. This should be a range within text that is set as the
accessibility label or accessibility value of the associated
element.

`prepare`

Optional closure to run before a Rotor entry
is navigated to, to prepare the UI as needed. This should be used to
bring the Accessibility element on-screen, if scrolling is needed to
get to it.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)