Contents

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.

Declaration

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.

  • 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.

See Also

Creating a rotor entry