A binding to a value that updates as the user rotates the Digital Crown. The implicit range is (-infinity, +infinity)
.
暗黙的な範囲は、(-infinity, +infinity)
です。
Instance Method
インスタンスメソッド
digital
digitalCrownRotation(_:)
Tracks Digital Crown rotations by updating the specified binding.
「デジタルクラウン」の回転をこの指定されたバインディングを更新することによって追跡します。
Availability 有効性
- watchOS 6.0+
Technology
- Swift
UI
Declaration 宣言
func digitalCrownRotation<V>(_ binding: Binding
<V>) -> some View
where V : BinaryFloatingPoint
Parameters パラメータ
binding
Discussion 議論
Use this method to receive values on a binding you provide as the user turns the Digital Crown on Apple Watch. The example below receives changes to the binding value, starting at 0
and incrementing or decrementing depending on the direction that the user turns the Digital Crown:
struct DigitalCrown: View {
private var crownValue = 0.0
var body: some View {
Text("Received Value:\(crownValue, specifier: "%.1f")")
.focusable()
.digitalCrownRotation($crownValue)
}
}