UncertainValue
struct UncertainValue<T, U> : Codable where T : Decodable, T : Encodable, U : Decodable, U : Encodable
Handle JSON values that may be different values Such as possibly quoted numbers
-
First possible value
Declaration
Swift
var tValue: T? -
Second possible value
Declaration
Swift
var uValue: U? -
Convenience access to Int if present
Declaration
Swift
var intValue: Int? { get } -
Convenience access to Double if present
Declaration
Swift
var doubleValue: Double? { get } -
Initalize with first type
Declaration
Swift
init(with value: T)Parameters
valueValue
-
Initalize with second type
Declaration
Swift
init(with value: U)Parameters
valueValue
-
Initialize with decoder
Throws
Decoding errorDeclaration
Swift
init(from decoder: Decoder) throwsParameters
decoderDecoder
-
Encode to encoder
Throws
Encoding errorDeclaration
Swift
func encode(to encoder: Encoder) throwsParameters
encoderEncoder
View on GitHub
UncertainValue Structure Reference