Daily iOS
Swift

Codable decoding strategies

The server's JSON uses snake_case keys, and dates come as strings like "2026-09-11T10:00:00Z". What would you set up on the decoder to decode this response with Codable?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Put the key and date conversion rules in one place on the decoder with keyDecodingStrategy and dateDecodingStrategy, and use CodingKeys when you need explicit mapping.

Share a question