Type

@objcMembers public class Type: NSObject, SourceryModel, Annotated

Defines Swift type

  • Whether declaration is an extension of some type

    Declaration

    Swift

    public var isExtension: Bool
  • Kind of type declaration, i.e. enum, struct, class, protocol or extension

    Declaration

    Swift

    public var kind: String
  • Type access level, i.e. internal, private, fileprivate, public, open

    Declaration

    Swift

    public let accessLevel: String
  • Type name in global scope. For inner types includes the name of its containing type, i.e. Type.Inner

    Declaration

    Swift

    public var name: String
  • Whether type is generic

    Declaration

    Swift

    public var isGeneric: Bool
  • Type name in its own scope.

    Declaration

    Swift

    public var localName: String
  • Variables defined in this type only, inluding variables defined in its extensions, but not including variables inherited from superclasses (for classes only) and protocols

    Declaration

    Swift

    public var variables: [Variable]
  • All variables defined for this type, including variables defined in extensions, in superclasses (for classes only) and protocols

    Declaration

    Swift

    public var allVariables: [Variable]
  • Methods defined in this type only, inluding methods defined in its extensions, but not including methods inherited from superclasses (for classes only) and protocols

    Declaration

    Swift

    public var methods: [Method]
  • All methods defined for this type, including methods defined in extensions, in superclasses (for classes only) and protocols

    Declaration

    Swift

    public var allMethods: [Method]
  • Subscripts defined in this type only, inluding subscripts defined in its extensions, but not including subscripts inherited from superclasses (for classes only) and protocols

    Declaration

    Swift

    public var subscripts: [Subscript]
  • All subscripts defined for this type, including subscripts defined in extensions, in superclasses (for classes only) and protocols

    Declaration

    Swift

    public var allSubscripts: [Subscript]
  • Bytes position of the body of this type in its declaration file if available.

    Declaration

    Swift

    public var bodyBytesRange: BytesRange?
  • All initializers defined in this type

    Declaration

    Swift

    public var initializers: [Method]
  • All annotations for this type

    Declaration

    Swift

    public var annotations: [String: NSObject] = [:]
  • Static variables defined in this type

    Declaration

    Swift

    public var staticVariables: [Variable]
  • Static methods defined in this type

    Declaration

    Swift

    public var staticMethods: [Method]
  • Class methods defined in this type

    Declaration

    Swift

    public var classMethods: [Method]
  • Instance variables defined in this type

    Declaration

    Swift

    public var instanceVariables: [Variable]
  • Instance methods defined in this type

    Declaration

    Swift

    public var instanceMethods: [Method]
  • Computed instance variables defined in this type

    Declaration

    Swift

    public var computedVariables: [Variable]
  • Stored instance variables defined in this type

    Declaration

    Swift

    public var storedVariables: [Variable]
  • Names of types this type inherits from (for classes only) and protocols it implements, in order of definition

    Declaration

    Swift

    public var inheritedTypes: [String]
  • Names of types or protocols this type inherits from, including unknown (not scanned) types

    Declaration

    Swift

    public var based = [String: String]()
  • Types this type inherits from (only for classes)

    Declaration

    Swift

    public var inherits = [String: Type]()
  • Protocols this type implements

    Declaration

    Swift

    public var implements = [String: Type]()
  • Contained types

    Declaration

    Swift

    public var containedTypes: [Type]
  • Contained types groupd by their names

    Declaration

    Swift

    public private(set) var containedType: [String: Type] = [:]
  • Name of parent type (for contained types only)

    Declaration

    Swift

    public private(set) var parentName: String?
  • Parent type, if known (for contained types only)

    Declaration

    Swift

    public var parent: Type?
  • Superclass type, if known (only for classes)

    Declaration

    Swift

    public var supertype: Type?
  • Type attributes, i.e. @objc

    Declaration

    Swift

    public var attributes: [String: Attribute]