SwiftUI 2.0: How To Perform Network Requests (2020)

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ต.ค. 2024
  • In this tutorial you will learn how to perform network requests to load json data from an URL and update your SwiftUI views correspondingly.
    Link to the JSON:
    picsum.photos/...
    Link to the Book (Amazon Affiliate Link):
    amzn.to/3cah0hM

ความคิดเห็น • 14

  • @ArchAid1
    @ArchAid1 3 ปีที่แล้ว +1

    I loved this! However, it was definitely not an "easy" explanation. I've gone over it three or four times and I'm only just starting to see how it actually works. But it was just what I needed, and it's super cool of you to put all this time and effort into making something that pushes beginners like me out of their comfort zone. Many many thanks 🙏

    • @BeyondOnesAndZeros
      @BeyondOnesAndZeros  3 ปีที่แล้ว

      Thanks Michael, glad you found it useful. Feel free to contact me if you have any questions :)

    • @holdenrey4506
      @holdenrey4506 3 ปีที่แล้ว

      I guess im randomly asking but does anyone know of a trick to log back into an Instagram account?
      I somehow lost the password. I love any help you can give me

  • @hcri
    @hcri 3 ปีที่แล้ว +2

    You are just one of my favorite teachers. I wish you lots of success. FOR YOU DESERVE IT...
    I hope that you will do a tutorial on JSON to Core Data.

  • @taslimfi
    @taslimfi 3 ปีที่แล้ว

    I wish I could give multiple thumbs up for this great tutorial!

  • @ganeshmahajan1985
    @ganeshmahajan1985 3 ปีที่แล้ว

    This is super clean approach. Thanks a lot for efforts making this video. It would be great if you share the code on git!
    Thanks again, keep rocking 😊

  • @tikhonnnnn
    @tikhonnnnn 3 ปีที่แล้ว +2

    Good way to perform get request, thanks. I have django application with auth 2.0, now I am trying to create authentication from swiftui app. I think it is good idea to create tutorial about best practice of authentication, perform post request and do it through ViewModel. You can talk about storing auth token in keychain in this tutorial, I already done this, but it can be interesting for other peoples...

    • @BeyondOnesAndZeros
      @BeyondOnesAndZeros  3 ปีที่แล้ว +2

      Thanks again! Will definitely put this on my list for future tutorials :)

  • @michaeldoprado4006
    @michaeldoprado4006 3 ปีที่แล้ว

    Excellent video !!

  • @nurlanakylbekov7266
    @nurlanakylbekov7266 3 ปีที่แล้ว

    Looks like this method avoids from extra networking request when the user uses navigation link

  • @ArchAid1
    @ArchAid1 3 ปีที่แล้ว

    But there is one thing that isn't obvious to me: The only variable that is @Published is result. However, in the SwiftUI body, when you're calling the items, you are using items.value. How are we accessing this, when it's not being published?

    • @BeyondOnesAndZeros
      @BeyondOnesAndZeros  3 ปีที่แล้ว +2

      Hi Michael, in this case SwiftUI is smart and knows that the current state of the "value" property depends on the published variable "result". Therefore, it infers that value has to also be published.

    • @ArchAid1
      @ArchAid1 3 ปีที่แล้ว

      @@BeyondOnesAndZeros ah. Brilliant. Thanks. Very neat 🙏🏻

  • @diegocamilopenaramirez6101
    @diegocamilopenaramirez6101 3 ปีที่แล้ว

    Do you have the source code?