ClosureType

@objcMembers
public final class ClosureType : NSObject, SourceryModel, Diffable
extension ClosureType: NSCoding

Describes closure type

  • Type name used in declaration with stripped whitespaces and new lines

    Declaration

    Swift

    public let name: String
  • List of closure parameters

    Declaration

    Swift

    public let parameters: [ClosureParameter]
  • Return value type name

    Declaration

    Swift

    public let returnTypeName: TypeName
  • Actual return value type name if declaration uses typealias, otherwise just a returnTypeName

    Declaration

    Swift

    public var actualReturnTypeName: TypeName { get }
  • Actual return value type, if known

    Declaration

    Swift

    public var returnType: Type?
  • Whether return value type is optional

    Declaration

    Swift

    public var isOptionalReturnType: Bool { get }
  • Whether return value type is implicitly unwrapped optional

    Declaration

    Swift

    public var isImplicitlyUnwrappedOptionalReturnType: Bool { get }
  • Return value type name without attributes and optional type information

    Declaration

    Swift

    public var unwrappedReturnTypeName: String { get }
  • Whether method is async method

    Declaration

    Swift

    public let isAsync: Bool
  • async keyword

    Declaration

    Swift

    public let asyncKeyword: String?
  • Whether closure throws

    Declaration

    Swift

    public let `throws`: Bool
  • throws or rethrows keyword

    Declaration

    Swift

    public let throwsOrRethrowsKeyword: String?
  • Declaration

    Swift

    public var asSource: String { get }
  • Declaration

    Swift

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