Member-only story
Decode JSON with Swift (& test!)
Download, decode and test? O.K. then
It is almost without exception essential that for any application (of a decent size) that you communicate with a backend server. This might be to get pertinent information, upload analytics information or any one of a host of reasons to communicate with another machine.
This article is about taking JSON and decoding it in an App.
Difficulty: Beginner | Easy | Normal | Challenging
Prerequisites:
- This article relies on knowledge of mocking in Swift, and of course you will need to set App Transport Security Settings. You’d also be well advised to understand the Equatable protocol
Terminology
API: Application programming interface. A set of accessible tools for building software applications
Backend: the part of a computer system or application that is not directly accessed by the user, typically responsible for storing and manipulating data
Endpoint: An endpoint is a remote computing device that communicates back and forth with a network to which it is connected
JSON: JavaScript Object Notation, a lightweight format for storing and transporting data