Handle Errors | raywenderlich.com

This is a companion discussion topic for the original entry at https://www.raywenderlich.com/10376245-networking-with-urlsession/lessons/31


This NEVER WORKS if you follow the video instructions as told.

So the Download Material β€˜starter’ actually had the bogus attribute in the JSON.

It would be better to make it an OPTIONAL in the starter folder and then have folks remove the ? to blow up the JSON parser.

So for example this will work:

struct ArtistInfo: Codable {
let biography: String
let photo: String
let totalAlbums: Int?

Then ask the student to remove the β€œ?” to force that field in your JSON result.

Enjoying the book!


@bdmoakley Can you please help with this when you get a chance? Thank you - much appreciated! :]