How to create a simple Binding for previews

You can use .constant(VALUE) in your Previews, no need to create a @State.

/// A value and a means to mutate it.
@propertyWrapper public struct Binding<Value> {

    /// Creates a binding with an immutable `value`.
    public static func constant(_ value: Value) -> Binding<Value>
}

e.g.

TestView(someProperty: .constant(5.0))

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)