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.
Initializerinit(_:
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.
Availability 有効性
- iOS 15.0+
- iPadOS 15.0+
- macOS 12.0+
- Mac Catalyst 15.0+
- tvOS 15.0+
- watchOS 8.0+
Technology
- Swift
UI
Declaration 宣言
init(_ labelKey: LocalizedStringKey
, textRange: Range
<String
.Index
>, prepare: @escaping (() -> Void
) = {})
Parameters パラメータ
labelKey
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.