iOS 15: Sending and receiving Codable data with URLSession and SwiftUI - Cupcake Corner Tutorial 2/9
Вставка
- Опубліковано 30 вер 2024
- Download the completed project here: github.com/two...
Other parts in Project 10:
Introduction: www.hackingwit...
1. Adding Codable conformance for @Published properties: • iOS 15: Adding Codable...
2. Sending and receiving Codable data with URLSession and SwiftUI: This video
3. Loading an image from a remote server: • iOS 15: Loading an ima...
4. Validating and disabling forms: • iOS 15: Validating and...
5. Taking basic order details: • iOS 15: Taking basic o...
6. Checking for a valid address: • iOS 15: Checking for a...
7. Preparing for checkout: • iOS 15: Preparing for ...
8. Encoding an ObservableObject class: • iOS 15: Encoding an Ob...
9. Sending and receiving orders over the internet: • iOS 15: Sending and re...
Wrap up and challenges: www.hackingwit...
You can find the full set of videos, along with transcriptions, challenges, tests, and more, in my free 100 Days of SwiftUI course: www.hackingwit...
Watch the full 100 Days of SwiftUI playlist here: • Hacking with iOS: Swif...
Me: Hehehehe
Friend: What's funny?
My brain: Taylor SwiftUI
I would like to practice more with different API’s, whats web url (website) for Apples API?
love u man, u save my day. Your tutorial is very well explained
Paul is in love with Taylor Swift ;)
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
where do you send the "codable" data?.
I only see static parameters in the url and not data from a "codable" structure...
Help
thank you for your lesson, this is awesome. You have a super cute dog btw
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.
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
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?
Do asynchronous functions in Swift run as a thread or a separate process?
how do we add custom headers to the request
Love your videos and dogs! 😄
Thanks man!
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?
In case you haven't already figured this out, I believe concurrency is a very new feature so it's possible you're just not up to date enough to use it like you said, yes
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?
You need to create "@State private var results = [Result]() "