iOS 15: Sending and receiving Codable data with URLSession and SwiftUI – Cupcake Corner Tutorial 2/9

preview_player
Показать описание

Other parts in Project 10:

2. Sending and receiving Codable data with URLSession and SwiftUI: This video

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

Me: Hehehehe
Friend: What's funny?
My brain: Taylor SwiftUI

enzmondo
Автор

I would like to practice more with different API’s, whats web url (website) for Apples API?

bigknightentertainment
Автор

love u man, u save my day. Your tutorial is very well explained

alexandreboyer
Автор

where do you send the "codable" data?.
I only see static parameters in the url and not data from a "codable" structure...

Help

millobello
Автор

This works perfectly when the url downloads a file, but how would it be done if the url shows the information without the need to download a file?

JenssenCaro
Автор

how do we add custom headers to the request

elmcapp
Автор

Nice video!
My attempt failed miserably because I try to use async await in an ObservableObject.
If I turn getData function into an asyncronous function the init prevents me from compiling the project.

EnglishTurkishExpert
Автор

thank you for your lesson, this is awesome. You have a super cute dog btw

HuyLe-hnle
Автор

Do asynchronous functions in Swift run as a thread or a separate process?

BlueXDShadow
Автор

Does this only work with the latest version of XCode? I have copied your example but get 'Value of type List has no member task' and async modifier is only valid when experimental concurrency is enabled. I'm totally new to swift UI so what have I missed?

venturoboy
Автор

One Mistake I think. (a misnomer.) You confused 'Results' with the 'Response' in your variable naming. What you are calling "Response" should actually have been called "Results" because decode returns a 'result set'. The "Response" is returned as the second parameter in (data, _). The 'URLResponse' is meta data about the results. With that said, Excellent lesson. This code will be my go-to example next time I'm pulling data from a REST API. Thanks

beemercycle
Автор

I'm having a "Cannot find 'results' in scope" error in the "results = decodedResponse.results" line. Cannot figure out what's the issue here. Anyone else had this error?

henriquemartins
Автор

Thanks a lot, but I'm not from America, so my English is very bad, and in this case I had to import subtitles from the video player

izzzanaaami