Initializer
init(from:fallbackDefaultValue:transform:)
Creates a variant collection from a given set of variant traits.
init?(from traits: Set<DocumentationDataVariantsTrait>, fallbackDefaultValue: Value, transform: (DocumentationDataVariantsTrait) -> Value?)
Parameters
traitsThe traits to consider when creating a variant collection.
fallbackDefaultValueA fallback value to use if the given transform function returns nil for the default trait.
transformThe function that should be used to transform the given variant trait to a value for the variant collection
Discussion
If there are no variants for the given traits, 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.