Options

public struct Options<EnumType> : OptionSet where EnumType : CaseIterable, EnumType : Hashable

Undocumented

  • The raw value of the option set.

    Declaration

    Swift

    public private(set) var rawValue: Int { get }
  • Initialize the option set via a raw value.

    Declaration

    Swift

    public init(rawValue: Int)
  • Initialize the option set via a case of the generic enum type.

    Declaration

    Swift

    public init(_ option: EnumType)
  • Initialize the option set via a combination of multiple cases of the generic enum type.

    Declaration

    Swift

    public init(arrayLiteral elements: EnumType...)

Utilites

  • all

    Convenience property of an instance containing all possible options.

    Declaration

    Swift

    public static var all: `Self` { get }
  • Convenience property returning all possible option combinations containing self, sorted by their raw values ascendingly.

    Declaration

    Swift

    public var allCombinationsContainingSelf: [`Self`] { get }
  • Convenience method returning all possible instances containing the given option, sorted by their raw values ascendingly.

    Declaration

    Swift

    public static func allContaining(_ option: EnumType) -> [`Self`]
  • Convenience method returning all possible instances containing the given option, sorted by their raw values ascendingly.

    Declaration

    Swift

    public static func allContaining(_ option: `Self`) -> [`Self`]
  • Convenience method returning an array of all cases contained in self, ordered by their respective option’s raw value.

    Declaration

    Swift

    public var decomposed: [EnumType] { get }