I'm trying to override some decode parsers from KeyedDecodingContainer, but
I getting a stranger ambiguous error. Is stranger for me, because I'm
getting this message error only on *Int* and *Double* override parse.
I appreciate any help because I don't know why the Float parse works and
Int got t
Ray,
For now, my strategy to date decoding is configuring
let decoder = JSONDecoder()
decoder.dateDecodingStrategy = JSONDecoder.DateDecodingStrategy.custom({
foo -> Date in
let container = try foo.singleValueContainer()
let dateStr = try container.decode(String.self)
return myCustomDateParse(da
Codable is great and I'm moving to it, but sometimes server return numbers
as a string and I have to force the parser to take care of this behavior.
I would like your opinion if this is the better solution to parse numbers
even when I got string.
Thanks,
Solli Honorio
import Foundation
extens
com/apple/swift/blob/master/lib/Sema/DerivedConformanceCodingKey.cpp>
> .
>
> Happy to answer any questions on this you might have.
>
> — Itai
>
> On 4 Oct 2017, at 14:50, Solli Honorio via swift-users wrote:
>
> Studying "Codable.swift" and "JSONEncoder.swift"
Studying "Codable.swift" and "JSONEncoder.swift" to understand how decoding
works under the hood, I got confused about how CodingKey is implemented for
'enum'. Shouldn't have an extension of RawRepresentable to implement the
CodingKey protocol?
This is the answer I'm looking for, how the CodingKey