Initializer
init(from:transform:)
Creates a variant collection of optional value from a symbol variants data of the same value type using the given transformation closure.
init<Wrapped>(from documentationDataVariants: DocumentationDataVariants<Wrapped>, transform: (DocumentationDataVariantsTrait, Value) -> Value = { $1 }) where Value == Wrapped?, Wrapped : Decodable, Wrapped : Encodable
Discussion
Use this initializer when the Value of the given DocumentationDataVariants is the variant collection’s Value wrapped in an Optional . If there are no variants for the symbol data, the variant collection encodes a nil value.
This initializer picks a variant (the Swift variant, if available) of the given symbol data as the default value for the variant collection. Other variants are encoded in the variant collection’s variants.