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 aString
valueSince
2.0.0Declaration
Swift
@objc public init(stringValue: String)
Parameters
stringValue
The
String
value to be stored -
Creates a
PrimitiveWrapper
instance holding anInt
valueSince
2.0.0Declaration
Swift
@objc public init(intValue: Int)
Parameters
intValue
The
Int
value to be stored -
Creates a
PrimitiveWrapper
instance holding aBool
valueSince
6.0.0Declaration
Swift
@objc public init(boolValue: Bool)
Parameters
boolValue
The
Bool
value to be stored -
Creates a
PrimitiveWrapper
instance holding aDecimal
valueSince
6.0.0Declaration
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 ofPrimitiveWrapper
Declaration
Swift
override public var description: String { get }