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

КОМЕНТАРІ • 19

  • @enzmondo
    @enzmondo 2 роки тому +13

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

  • @bigknightentertainment2746
    @bigknightentertainment2746 5 місяців тому

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

  • @alexandreboyer7714
    @alexandreboyer7714 2 роки тому +2

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

  • @devlanderjs
    @devlanderjs Рік тому +1

    Paul is in love with Taylor Swift ;)

  • @beemercycle
    @beemercycle 2 роки тому +1

    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

  • @millobello9469
    @millobello9469 2 роки тому +1

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

  • @HuyLe-hn9le
    @HuyLe-hn9le 2 роки тому +1

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

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

  • @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

  • @JenssenCaro
    @JenssenCaro 2 роки тому

    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?

  • @BlueXDShadow
    @BlueXDShadow Рік тому

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

  • @elmcapp6032
    @elmcapp6032 Рік тому

    how do we add custom headers to the request

  • @codingkim5714
    @codingkim5714 2 роки тому

    Love your videos and dogs! 😄

  • @validmohammadi7957
    @validmohammadi7957 Рік тому

    Thanks man!

  • @venturoboy
    @venturoboy 2 роки тому +1

    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

  • @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]() "