Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/mohsinaliayub/encoding-decoding-swift
- Owner: mohsinaliayub
- Created: 2024-08-03T21:54:19.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-08-04T00:22:58.000Z (6 months ago)
- Last Synced: 2024-11-19T17:57:09.841Z (2 months ago)
- Language: Swift
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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