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

  Рет қаралды 18,343

Paul Hudson

Paul Hudson

Күн бұрын

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...

Пікірлер: 19
@enzmondo
@enzmondo 2 жыл бұрын
Me: Hehehehe Friend: What's funny? My brain: Taylor SwiftUI
@alexandreboyer7714
@alexandreboyer7714 2 жыл бұрын
love u man, u save my day. Your tutorial is very well explained
@HuyLe-hn9le
@HuyLe-hn9le 2 жыл бұрын
thank you for your lesson, this is awesome. You have a super cute dog btw
@bigknightentertainment2746
@bigknightentertainment2746 5 ай бұрын
I would like to practice more with different API’s, whats web url (website) for Apples API?
@codingkim5714
@codingkim5714 2 жыл бұрын
Love your videos and dogs! 😄
@millobello9469
@millobello9469 2 жыл бұрын
where do you send the "codable" data?. I only see static parameters in the url and not data from a "codable" structure... Help
@JenssenCaro
@JenssenCaro Жыл бұрын
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?
@EnglishTurkishExpert
@EnglishTurkishExpert Жыл бұрын
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.
@devlanderjs
@devlanderjs Жыл бұрын
Paul is in love with Taylor Swift ;)
@beemercycle
@beemercycle 2 жыл бұрын
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
@BlueXDShadow
@BlueXDShadow Жыл бұрын
Do asynchronous functions in Swift run as a thread or a separate process?
@validmohammadi7957
@validmohammadi7957 Жыл бұрын
Thanks man!
@elmcapp6032
@elmcapp6032 Жыл бұрын
how do we add custom headers to the request
@venturoboy
@venturoboy 2 жыл бұрын
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?
@JulianWorden
@JulianWorden 2 жыл бұрын
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
@izzzanaaami
@izzzanaaami 2 жыл бұрын
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
@henriquemartins8735
@henriquemartins8735 2 жыл бұрын
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?
@梁非凡-h6i
@梁非凡-h6i 2 жыл бұрын
You need to create "@State private var results = [Result]() "
The day of the sea 😂 #shorts by Leisi Crazy
00:22
Leisi Crazy
Рет қаралды 1,5 МЛН
iPhone or Chocolate??
00:16
Hungry FAM
Рет қаралды 35 МЛН
Пришёл к другу на ночёвку 😂
01:00
Cadrol&Fatich
Рет қаралды 11 МЛН
How To Work With Any API (API Tutorial using URL Requests)
27:07
CodeWithChris
Рет қаралды 125 М.
Swift API Calls for Beginners (Networking) - Async Await & JSON
25:35
Codable, Decodable, and Encodable in Swift | Continued Learning #21
35:23
Swiftful Thinking
Рет қаралды 20 М.
Ch. 6.3 API call with URLSession and JSON parsing with SwiftUI (CatchEmAll app)
28:17
The day of the sea 😂 #shorts by Leisi Crazy
00:22
Leisi Crazy
Рет қаралды 1,5 МЛН