MethodParameter

@objcMembers
public class MethodParameter : NSObject, SourceryModel, Typed, Annotated, Diffable
extension MethodParameter: NSCoding

Describes method parameter

  • Parameter external name

    Declaration

    Swift

    public var argumentLabel: String?
  • Parameter internal name

    Declaration

    Swift

    public let name: String
  • Parameter type name

    Declaration

    Swift

    public let typeName: TypeName
  • Parameter flag whether it’s inout or not

    Declaration

    Swift

    public let `inout`: Bool
  • Is this variadic parameter?

    Declaration

    Swift

    public let isVariadic: Bool
  • Parameter type, if known

    Declaration

    Swift

    public var type: Type?
  • Parameter type attributes, i.e. @escaping

    Declaration

    Swift

    public var typeAttributes: AttributeList { get }
  • Method parameter default value expression

    Declaration

    Swift

    public var defaultValue: String?
  • Annotations, that were created with // sourcery: annotation1, other = “annotation value”, alterantive = 2

    Declaration

    Swift

    public var annotations: Annotations
  • Declaration

    Swift

    public var asSource: String { get }
  • Declaration

    Swift

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

    Swift

    public override var hash: Int { get }
  • Whether type is optional. Shorthand for typeName.isOptional

    Declaration

    Swift

    public var isOptional: Bool { get }
  • Whether type is implicitly unwrapped optional. Shorthand for typeName.isImplicitlyUnwrappedOptional

    Declaration

    Swift

    public var isImplicitlyUnwrappedOptional: Bool { get }
  • Type name without attributes and optional type information. Shorthand for typeName.unwrappedTypeName

    Declaration

    Swift

    public var unwrappedTypeName: String { get }
  • Actual type name if declaration uses typealias, otherwise just a typeName. Shorthand for typeName.actualTypeName

    Declaration

    Swift

    public var actualTypeName: TypeName? { get }
  • Whether type is a tuple. Shorthand for typeName.isTuple

    Declaration

    Swift

    public var isTuple: Bool { get }
  • Whether type is a closure. Shorthand for typeName.isClosure

    Declaration

    Swift

    public var isClosure: Bool { get }
  • Whether type is an array. Shorthand for typeName.isArray

    Declaration

    Swift

    public var isArray: Bool { get }
  • Whether type is a set. Shorthand for typeName.isSet

    Declaration

    Swift

    public var isSet: Bool { get }
  • Whether type is a dictionary. Shorthand for typeName.isDictionary

    Declaration

    Swift

    public var isDictionary: Bool { get }