WrapperCompatible

public protocol WrapperCompatible

属性包装器兼容协议

自定义wrapperExtension为任意名称(如app)示例:

extension WrapperCompatible {
    public static var app: Wrapper<Self>.Type { get { wrapperExtension } set {} }
    public var app: Wrapper<Self> { get { wrapperExtension } set {} }
}

使用示例:

String.app.jsonEncode(object)
  • 关联类型

    Declaration

    Swift

    associatedtype WrapperBase
  • wrapperExtension Default implementation

    wrapperExtension类包装器属性

    Default Implementation

    wrapperExtension类包装器属性

    Declaration

    Swift

    static var wrapperExtension: Wrapper<WrapperBase>.Type { get set }
  • wrapperExtension Default implementation

    wrapperExtension对象包装器属性

    Default Implementation

    wrapperExtension对象包装器属性

    Declaration

    Swift

    var wrapperExtension: Wrapper<WrapperBase> { get set }

WrapperCompatible

  • fw Extension method

    fw类包装器属性

    Declaration

    Swift

    public static var fw: Wrapper<Self>.Type { get set }
  • fw Extension method

    fw对象包装器属性

    Declaration

    Swift

    public var fw: Wrapper<Self> { get set }