var wrappedValue : Value
The underlying value referenced by the state variable.
状態変数によって参照される基礎をなす値。
Availability 有効性
Technology
var projectedValue: Binding
<Value> { get }
Use the projected value to pass a binding value down a view hierarchy.
投影値を使って、バインディング値をビュー階層に通達してください。
To get the projected
, prefix the property variable with a dollar sign ($
). In the following example, Player
projects a binding of the state property is
to the Play
view using $is
:
struct PlayerView: View {
var episode: Episode
private var isPlaying: Bool = false
var body: some View {
VStack {
Text(episode.title)
.foregroundStyle(isPlaying ? .primary : .secondary)
PlayButton(isPlaying: $isPlaying)
}
}
}
var wrappedValue : Value