Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mohsinaliayub/encoding-decoding-swift

Encoding & Decoding data in Swift with Codable protocol
https://github.com/mohsinaliayub/encoding-decoding-swift

Last synced: 6 days ago
JSON representation

Encoding & Decoding data in Swift with Codable protocol

Awesome Lists containing this project

README

        

# Encoding & Decoding in Swift with Codable
**Codable** protocol is used to both encode and decode our models into/from various data formats, including JSON, XML and Property Lists).

The playground contains lots of common use-cases that require us to encode/decode our model objects.

Here is a list of use-cases that are implemented for now:
1. Encoding/Decoding Nested Types
2. Encoding/Decoding Our Models to and from Snake Case in JSON
3. Create Custom JSON Keys (with CodingKey protocol)
4. Create Flat JSON Hierarchies
5. Work with Deep JSON Hierarchies
6. Encoding and Decoding Custom Date Representation
7. Encoding and Decoding Subclasses
8. Handling Arrays with Mixed Types
9. Working with Unkeyed Container
10. Working with Nested Unkeyed Container