PrimitiveWrapper

@objc(GFYPrimitiveWrapper)
public class PrimitiveWrapper : NSObject, Encodable

Wrapper for primitive values (String, Int, Boolean or Decimal) for use in Product.customProperties. Holds a value of one type at a time.

  • Creates a PrimitiveWrapper instance holding a String value

    Since

    2.0.0

    Declaration

    Swift

    @objc
    public init(stringValue: String)

    Parameters

    stringValue

    The String value to be stored

  • Creates a PrimitiveWrapper instance holding an Int value

    Since

    2.0.0

    Declaration

    Swift

    @objc
    public init(intValue: Int)

    Parameters

    intValue

    The Int value to be stored

  • Creates a PrimitiveWrapper instance holding a Bool value

    Since

    6.0.0

    Declaration

    Swift

    @objc
    public init(boolValue: Bool)

    Parameters

    boolValue

    The Bool value to be stored

  • Creates a PrimitiveWrapper instance holding a Decimal value

    Since

    6.0.0

    Declaration

    Swift

    @objc
    public init(decimalValue: Decimal)

    Parameters

    decimalValue

    The Decimal value to be stored

  • Encodes an instance of PrimitiveWrapper

    Declaration

    Swift

    public func encode(to encoder: Encoder) throws
  • Retrieves String representation of PrimitiveWrapper

    Declaration

    Swift

    override public var description: String { get }