Type Property

defaultValue

The default value of the preference.

Required. Default implementation provided.

Declaration

static var defaultValue: Self.Value { get }

Discussion

Views that have no explicit value for the key produce this default value. Combining child views may remove an implicit value produced by using the default. This means that reduce(value: &x, nextValue: {defaultValue}) shouldn’t change the meaning of x.

Default Implementations

PreferenceKey Implementations

static var defaultValue: Self.Value

Let nil-expressible values default-initialize to nil.