Protocol

PreferenceKey

A named value produced by a view.

Declaration

protocol PreferenceKey

Overview

A view with multiple children automatically combines its values for a given preference into a single value visible to its ancestors.

Topics

Associated Types

associatedtype Value

The type of value produced by this preference.

Required.

Type Properties

static var defaultValue: Self.Value

The default value of the preference.

Required. Default implementation provided.

Type Methods

static func reduce(value: inout Self.Value, nextValue: () -> Self.Value)

Combines a sequence of values by modifying the previously-accumulated value with the result of a closure that provides the next value.

Required.

Relationships

Conforming Types

See Also

Preferences

struct LocalizedStringKey

The key used to look up a string in a strings file or strings dictionary file.