SwSwift · Lesson 6 of 8
Errors & async/await
Two things every real app does: handle failures and wait for the network. Swift makes both explicit — throws in the signature, await at the call site.
◆ Note
Codable is Swift's built-in JSON serialization: declare a struct matching the JSON's shape, and encoding/decoding is automatic. Combined with async/await, a typed network call is ~5 lines with zero libraries.
Codable is Swift's built-in JSON serialization: declare a struct matching the JSON's shape, and encoding/decoding is automatic. Combined with async/await, a typed network call is ~5 lines with zero libraries.