Enum

@objcMembers
public final class Enum : Type

Defines Swift enum

  • Declaration

    Swift

    public class var kind: String { get }
  • Returns “enum”

    Declaration

    Swift

    public override var kind: String { get }
  • Enum cases

    Declaration

    Swift

    public var cases: [EnumCase]
  • Enum raw value type name, if any. This type is removed from enum’s based and inherited types collections.

    Important

    Unless raw type is specified explicitly via type alias RawValue it will be set to the first type in the inheritance chain. So if your enum does not have raw value but implements protocols you’ll have to specify conformance to these protocols via extension to get enum with nil raw value type and all based and inherited types.

    Declaration

    Swift

    public var rawTypeName: TypeName? { get set }
  • Enum raw value type, if known

    Declaration

    Swift

    public var rawType: Type?
  • Names of types or protocols this type inherits from, including unknown (not scanned) types

    Declaration

    Swift

    public override var based: [String : String] { get set }
  • Whether enum contains any associated values

    Declaration

    Swift

    public var hasAssociatedValues: Bool { get }
  • Declaration

    Swift

    override public func diffAgainst(_ object: Any?) -> DiffableResult