Initializer
init(from:transform:)
Creates a variant collection from a non-empty symbol variants data of the same value type using the given transformation closure.
init?(from documentationDataVariants: DocumentationDataVariants<Value>, transform: (DocumentationDataVariantsTrait, Value) -> Value = { $1 })
Discussion
Use this initializer when the Value of the given DocumentationDataVariants is the same as the variant collection’s Value. If there are no variants for the symbol data, this initializer returns nil.
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.