Generic Instance Method

preference(key:value:)

Sets a value to return for the given preference key when accessed by ancestors.

Declaration

func preference<K>(key _: K.Type = K.self, value: K.Value) -> some View where K : PreferenceKey