<!--
{
  "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(_:textRange:prepare:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI23AccessibilityRotorEntryV_9textRange7prepareACys5NeverOG10Foundation23LocalizedStringResourceV_SnySS5IndexVGyyctcAGRszrlufc::OverloadGroup"
  },
  "title" : "init(_:textRange:prepare:)"
}
-->

# init(_:textRange:prepare:)

Create a Rotor entry with a specific label and range. This Rotor entry
will be associated with the Accessibility element that owns the Rotor.

```
@export(implementation) init(_ label: LocalizedStringResource, textRange: Range<String.Index>, prepare: @escaping () -> Void = {}) where ID == Never
```

## Parameters

`label`

Localized string used to show this Rotor entry
to users. If no label is specified, the Rotor entry will be labeled
based on the text at that range.

`textRange`

Range of text associated with this Rotor
entry.

`prepare`

Optional closure to run before a Rotor entry
is navigated to, to prepare the UI as needed. This can be used to
bring the UI element or text on-screen if it isn’t already,
and SwiftUI not able to automatically scroll 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)