var projectedValue : Binding<Value>
A binding to the state value.
状態値へのバインディング。
Availability 有効性
Technology
var wrappedValue: Value { get nonmutating set }
This property provides primary access to the value’s data. However, you don’t access wrapped
directly.
このプロパティは、値のもつデータに対する主要なアクセスを提供します。しかしながら、あなたはwrapped
に直接にアクセスしません。
Instead, you refer to the property variable created with the State
attribute. In the following example, the button’s label depends on the value of is
and its action toggles the value of is
. Both of these accesses implicitly rely on the state property’s wrapped value.
struct PlayButton: View {
private var isPlaying: Bool = false
var body: some View {
Button(isPlaying ? "Pause" : "Play") {
isPlaying.toggle()
}
}
}
var projectedValue : Binding<Value>