NEWER VIDEO LINKED IN DESC. Ch. 6.3 API call with URLSession and JSON parsing with SwiftUI

preview_player
Показать описание
We'll build a fairly reusable function to make an API call, and we'll learn to parse JSON using SwiftUI's Codable protocol. We'll learn URLSession, converting a String to a URL type, we'll deliberately show common errors to hopefully help you recognize and correct these if you encounter them in the future, and when we're done, we'll have the first page of Pokemon data loaded into our app.
Part of a university course by Prof. John Gallaugher designed for the absolute beginner, where students will learn to program using Swift + SwiftUI. The course will move from no assumed prior programming experience while students learn fundamental, then intermediate and advanced concepts, culminating in a full stack app. Full free course playlist at:

Рекомендации по теме
Комментарии
Автор

thanks for your videos. Best regards from Moscow.

medicaldoctoronyoutube
Автор

You have explained this vividly and simple. thanks I finally understood.

chepparing
Автор

This video has been helpful. Thank you.

ajaden
Автор

Thank you very much, your explanation is very cool 🙂

magedmohmed
Автор

Hi John, excellent explanation on API Call with JSON parsing ! Thank you very much for sharing !

leighreddy
Автор

Experienced devs may note that I did not use @MainActor in the ViewModel. This was on purpose. I will be showing the “purple error” in the next lesson when we run in the simulator and will show how MainActor fixes this.

profgallaugher
Автор

Hie, You video help me a lot but I am stuck with one issue, when i hit the API then I get this error "Json Error: Could not decode returned data". Thank you

AromaVerma-ct
Автор

Excellent explanation… just question. Why you declared structs inside class?

Mahadev-xu
Автор

Thanks prof for the great lesson.

@27.09 regarding the "Hashable" error, I noticed this problem can be fixed if we specify id:\.self.name rather than id:\.self . I suspect this is due to id:\.self is trying to use the array as unique ID thus requiring to conform to Hashable vs using just the String property .name as unique ID which does not require Hashable protocol

lalaland
welcome to shbcf.ru