Day #33

Codable (Part 3 of 4)

It is possible to make a custom keyDecodingStrategy. However, I think it is not worth the effort since working with strings in Swift is the most annoying thing ever. You might as well hardcode everything like in day #31 at that point - it’ll make your app faster.

See here for example implementation: https://martiancraft.com/blog/2018/08/Implementing-custom-key-strategy-for-coding-types/

Originally published 09/18/2021 https://pittcsc.org/, republished 09/09/2022.

Licensed under CC BY-NC-SA 4.0
Last updated on Sep 18, 2021 00:00 UTC
Built with Hugo
Theme Stack designed by Jimmy