I'm starting to rewrite an application and I want to use Swift 4 Codable protocol to automatically convert json string to Objects and Structs.
Sometimes, specially at the beginning of coding, I encountered decoding problems, so I want to print these errors (whithout using always the debugger), in case some beans are not decoded correctly.
The problem is this:
As you can see, in the debugger, on "decodingError" object there is both:
- the key that has got the problem (NominativoModel.denNome)
- the error encountered (Expected to encode Array bla bla bla...).
My problem is that the only properties of that element, in the code, are errorDescription, failureReason, etc, that are ALL nil.
How can I print the values that are correctly displayed in the debugger?