Post marked as solved
Click to stop watching this thread.
You have stopped watching this post. Click to start watching again.
Post marked as solved with 2 replies, 0 views
Answer my own question here, it was a silly mistake from me, the error was about the container not the encoder, correct code looks as follows
let encoder = JSONEncoder()
encoder.dateEncodingStrategy = .custom({ date, encoder in
var container = encoder.singleValueContainer()
try container.encode(date.timeIntervalSince1970)
})
It's been a long year!!!!