Initializer

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: Text? = nil, textRange: Range<String.Index>, prepare: @escaping (() -> Void) = {}) where ID == Never

Parameters パラメータ

label

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

range

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.