ValueWrapper

public struct ValueWrapper<ReferenceType: NSCopying & AnyObject>

Pièce de résistance of this framework – a wrapper to enable the use of reference types with value-like semantics

  • initializer for storing a copy of the reference object as a template for future copies

    Declaration

    Swift

    public init?(template: ReferenceType)

    Parameters

    template

    object to copy

  • independant value aka copy of the original reference

    Declaration

    Swift

    public var value: ReferenceType?
  • equality driven by the underline object’s equality operator

    Declaration

    Swift

    public static func == (lhs: ValueWrapper<ReferenceType>, rhs: ValueWrapper<ReferenceType>) -> Bool