async await with API example | Swift Hindi tutorial

Поделиться
HTML-код
  • Опубликовано: 24 дек 2024

Комментарии •

  • @afzalansari-jq4qd
    @afzalansari-jq4qd 3 года назад +20

    i can guarantee that even paid course anywhere dont teach you like how you explain each and every thing keep up the good work its really helpfull for developers like me to find content like yours

  • @risky_bet
    @risky_bet 2 года назад +3

    This is my go-to channel for iOS stuff. Learned alot in past from you and still learning. What sets you apart from other is you tell us not only how to do things but also how not to do things also.
    Ravi bhai mast kam karata hai tum, mereko tumako ♥️ se thank you bolane ka hai.

    • @CodeCat15
      @CodeCat15  2 года назад

      Thank you for your kind words bhai, I am glad the video was helpful

  • @JunaidKhan-ny8tu
    @JunaidKhan-ny8tu 2 года назад +1

    itni mehant(hard-work) Ravi Bhai

    • @CodeCat15
      @CodeCat15  2 года назад +1

      Thank you Junaid 🙏

    • @JunaidKhan-ny8tu
      @JunaidKhan-ny8tu 2 года назад +1

      @@CodeCat15 typo mistake . Too much hard work you do for your followers. Keep it up

  • @ssaai
    @ssaai 3 года назад +3

    Excellent 👏👏👏👏👏👏👏👏

  • @piyushagrawal08
    @piyushagrawal08 3 года назад +1

    Love to see you back with fire 🔥! Awesome video!

  • @siddharthkothari007
    @siddharthkothari007 Год назад +1

    amazing series Ravi. thanks a lot. binge watched the whole playlist. 👌

    • @CodeCat15
      @CodeCat15  Год назад

      Glad it was helpful Siddharth

  • @sarwatsajida275
    @sarwatsajida275 3 года назад +1

    why your content so good :) ...You are really saviour...you just explain each and every bit in a such a way that where anyone can understand. kudos to you.. sharing your videos to my fellow mates. Thank you once again.

    • @CodeCat15
      @CodeCat15  3 года назад

      Thank you for the kind words, I am glad the content is helping you, feel free to ask questions on this topic and do share the channel with your iOS group

  • @umairahmad4368
    @umairahmad4368 3 года назад +1

    Thank you Sir for these informative videos. Very helpful & we always learn new things in each video.

    • @CodeCat15
      @CodeCat15  3 года назад +1

      Am glad this was helpful 🙏 hopefully the content will be helpful even while you are preparing for interviews

    • @umairahmad4368
      @umairahmad4368 3 года назад +1

      @@CodeCat15
      Thank You for your kind words

  • @rahuljamba5846
    @rahuljamba5846 3 года назад +1

    Great Sir G !! Excellent Work.

    • @CodeCat15
      @CodeCat15  3 года назад +1

      Thank you 🙏 I am glad this was helpful, please feel free to ask questions and do share the video with your iOS group

  • @ajaychaudhary358
    @ajaychaudhary358 3 года назад +1

    I really like all your videos... you explain every topic in a very simple and interesting way.

    • @CodeCat15
      @CodeCat15  3 года назад

      Thank you for your kind words Ajay 😊 plz feel free to ask questions and do share the video with your iOS group

  • @pawanpandey9257
    @pawanpandey9257 3 года назад +1

    Great Sir !! Excellent Work

    • @CodeCat15
      @CodeCat15  3 года назад

      Glad this was helpful 🙏

  • @kalpeshjethva598
    @kalpeshjethva598 9 месяцев назад

    Thank you Ravi for this wonderful series.

    • @CodeCat15
      @CodeCat15  6 месяцев назад +1

      Glad it was helpful Kalpesh, please feel free to ask questions and do share the video with your iOS group.

  • @vishnunair4997
    @vishnunair4997 3 года назад +1

    This was much awaited video. !!❤️

    • @CodeCat15
      @CodeCat15  3 года назад

      Indeed, I have mentioned the reason why the video was delayed but I am glad now it’s out 😊 plz feel free to ask questions and do share the video with your iOS group

  • @sandipkhedkar
    @sandipkhedkar 3 года назад +1

    Superb! Ravi, Thank you so much.

    • @CodeCat15
      @CodeCat15  3 года назад

      I am glad this was helpful 😊

  • @sakirsaiyed49
    @sakirsaiyed49 2 года назад +1

    Awesome learning with simplest manner... thanks a lot.. keep doing great work :)

    • @CodeCat15
      @CodeCat15  2 года назад

      I am glad this video was helpful, please feel free to ask questions on the topic or share the video with your iOS group

  • @subhadeepchakraborty4638
    @subhadeepchakraborty4638 3 года назад +1

    Thanks for another informative video.

  • @garimapandey1006
    @garimapandey1006 2 года назад +1

    Hi Ravi , I really like all your videos... You explain every topic in a very simple and interesting way.

    • @CodeCat15
      @CodeCat15  2 года назад +1

      Thank you Garima, am glad these videos are helpful. Please feel free to ask questions and do share the channel with your iOS group 😊

  • @nainasoni7831
    @nainasoni7831 3 года назад +1

    Helpful video, as always 👍👍

    • @CodeCat15
      @CodeCat15  3 года назад

      Glad this was helpful 😊

  • @kaushalparmar5483
    @kaushalparmar5483 2 года назад

    Good explaination video found gold in heap :)

  • @raghuramanandhan668
    @raghuramanandhan668 6 месяцев назад

    Learning a lot from you. Would you kindly include subtitles to your videos? They would be really beneficial.

  • @electrowave8012
    @electrowave8012 3 года назад

    Thank you very much for this video. I love your videos I got lot of confidence after subscribing your channel.

    • @CodeCat15
      @CodeCat15  3 года назад

      Glad that the channel has helped you this much, thank you for your kind words and feedback means a lot to me

  • @yashparikh2527
    @yashparikh2527 3 года назад +2

    Before I watched hecking with swift video all most two months ago related of async wait
    But not show bug
    Thanks you for providing latest method with own language (Hindi)

    • @CodeCat15
      @CodeCat15  3 года назад +1

      When I found one bug in the toolchain I was a little hesitant to show this feature, coz I knew this was a complex integration and bugs are bound to come and hence I delayed this.
      Every second channel was showing async await and I was like damn everyone on RUclips is in a race to show this feature first 😅 for views maybe but I am tortoise in that case

  • @Rahul-jf5kf
    @Rahul-jf5kf 2 года назад +1

    Thank you so much Ravi, this is the most readable, understandable and easy to maintain code for webservice call I have seen, One doubt I have, in case of error(error in http response or error in error variable) we want to display error Message in alert, Where should I place it, 1) In HttpUtility then i need to pass reference of controller thorough all functions or 2) in ViewContoller itself in this case code gets repeated for all viewcontrollers

    • @CodeCat15
      @CodeCat15  2 года назад

      the error can be returned in the delegate function and can be displayed on the main thread on the view controller

  • @DhavalHNena
    @DhavalHNena 3 года назад +1

    I was thinking how will we break the await call sequence from the first function call which is not async in nature i.e here from view controller.. now got to know that "Task" helps here to break that await call chain. Thanks again for sharing another great content.

    • @CodeCat15
      @CodeCat15  3 года назад +1

      I am yet to try async await with SwiftUI and am assuming there it would be even more helpful as compared to UIKit thanks to the pub-sub approach, I don’t really like the Task approach but it is what it is I guess.
      Glad the video the was helpful 🙏 feel free to ask questions and do share the video with your iOS group

  • @ombhagwan859
    @ombhagwan859 3 года назад +1

    Video is awsm as usual. Very helpful to implement to own project .
    Means this is working for any asynchronous call.can we avoid dispatch group uses?

    • @CodeCat15
      @CodeCat15  3 года назад +2

      Dispatch group solves a different problem as compared to async await and hence it’s too early to say let’s dump the dispatch framework and use async await permanent.
      If I want to call 5 APIs all at once and I don’t care about the sequence then in that case DG is more useful as compared to async await

  • @sureshdurishetti5835
    @sureshdurishetti5835 Год назад +1

    Hi Ravi, what if getToken() method takes much time (1 min), will getPayroll gives error?
    If yes, how to dependency for those 2 async methods (without operationqueues)?

    • @CodeCat15
      @CodeCat15  Год назад

      You can use async await now to handle such use cases and that way when the first operation fails you can send the appropriate message from your service layer to the viewModel.
      If an api is taking more than a minute then that’s a performance bottleneck of that api and the api developers must fix that on priority

    • @sureshdurishetti5835
      @sureshdurishetti5835 Год назад

      @@CodeCat15
      let resultFirst = await testAsyncWaitFirstAPICall() //takes 10 sec
      let resultSecond = await testAsyncWaitTwoAPICall(input: resultFirst) // takes 5 sec
      print("hello test") // some code after async-await
      Que: Will print executed immediately OR after await completion? What I understand is, await will block the current execution flow, correct?

  • @suryakantsharma6761
    @suryakantsharma6761 Год назад +1

    can you please tell how to write unit test as well for async await function. you can drive from TDD

    • @CodeCat15
      @CodeCat15  Год назад

      One of the highly recommended resources for understanding Clean Architecture be it iOS or any other technology that you learn in the future is the book "Clean Architecture: A Craftsman's Guide to Software Structure and Design" by Robert C. Martin (Uncle Bob). This book provides in-depth insights into Clean Architecture principles and how to apply them to iOS development.

  • @prasadsanaboina557
    @prasadsanaboina557 2 года назад +1

    Thank you so much bro

    • @CodeCat15
      @CodeCat15  2 года назад

      No problem, I am glad this was helpful

  • @neelampursnani1637
    @neelampursnani1637 2 года назад +1

    the great explanation. Loved it..! I would like to know how we can unit test the HttpUtility class as this has the generic function.

    • @CodeCat15
      @CodeCat15  2 года назад

      The HttpUtility class has URLSession calls which is an apple class and has no business logic or any special cases, so writing test cases for this library would be futile because you would write test cases for your service layers which will use this utility so in a way you would end up indirectly testing the utility.

  • @jonysingla19
    @jonysingla19 Год назад

    Hi Ravi, Thanks a lot for sharing this video. It's so fruit full. But I Have doubts for same: we are creating same nested cycles after one API to another API. It's like same dependency one API to another, so how we fixed this? Apart from that everything is awesome.

  • @puneetpal1466
    @puneetpal1466 3 года назад +1

    Thank you 😊

    • @CodeCat15
      @CodeCat15  3 года назад

      Glad it was helpful, do share the video with your iOS group and feel free to ask questions 👍

  • @pratikgupta7373
    @pratikgupta7373 3 года назад +1

    Nice Tutorial !
    one question do u know how to check Crashlytics Crash

    • @CodeCat15
      @CodeCat15  3 года назад

      This link will guide you out for the crashlytics logs
      firebase.google.com/docs/crashlytics/test-implementation?platform=ios

    • @pratikgupta7373
      @pratikgupta7373 3 года назад

      @@CodeCat15 thanks ravi

  • @nileshuttekar6473
    @nileshuttekar6473 2 года назад

    Thanks Ravi. This is really nice..
    Just one query. Async/await runs on which thread main thread or global thread?

    • @mohdrahib205
      @mohdrahib205 Год назад

      When you use async/await in Swift, the code runs on a separate concurrent thread managed by the system, rather than the main thread.

  • @Arlabs-n4e
    @Arlabs-n4e Год назад

    I like and want to use the Async await in one of the application but there are some rest APIs that are getting failed to respond, how can I manage a retry call with Async await. If I want to retry more then 3 times and still fail then I need to continue with the next api...How can I manage the retry flow can you pls explain?

  • @priyankamorey3192
    @priyankamorey3192 3 года назад +1

    Thank you Ravi for sharing latest important information and I really like it 👍Can we achieve multiple calls at a time by this async / await?

    • @CodeCat15
      @CodeCat15  3 года назад +1

      Glad it was helpful Priyanka, as the this SO post it seems it can be done, I have not tried doing that yet but surely will release an IG video on it if needed
      stackoverflow.com/questions/70172361/how-to-run-multiple-api-call-simultaneously-using-async-await-in-swift

  • @lordironman2874
    @lordironman2874 3 года назад +1

    Thank you Sir, for this amazing video with such a nice explanations. Can you do time test for different approaches?

    • @CodeCat15
      @CodeCat15  3 года назад +1

      That’s a wonderful suggestion I would love doing that in the future videos, I have made a note of it and to test this I have some complex use cases in mind as well.
      Thank you for suggesting this

    • @lordironman2874
      @lordironman2874 3 года назад

      @@CodeCat15 Welcome Sir

  • @bharatkakadiya6696
    @bharatkakadiya6696 3 года назад +1

    Hello Ravi,
    I hope you doing very well.
    If we have to show any alert when error comes from server or request time out then how can we do it?
    Some time we have to create one error screen for reload data so how can we manage?

    • @CodeCat15
      @CodeCat15  3 года назад

      In this case you may display the error in the Task struct, although I am not a big fan of how its done, since this feature is new I too am playing around with it and will be showing more of it in the coming videos as the swift community will be adapting async await heavily in their code.

  • @neerajgurjar3879
    @neerajgurjar3879 3 года назад +1

    Hello
    In second view controller i click on button and call this code which dismiss the controller
    Self.dismiss(animation: true, completion: nil)
    What i want is after press the button it took 5 seconds of time to dismissed the controller screen

    • @CodeCat15
      @CodeCat15  3 года назад

      Task awaits the async operations to complete, a little detail is provided in the actor video as to how Task works and maybe the delay is because Task is trying to finish the async task first and then dismiss the controller.

  • @yashparikh2527
    @yashparikh2527 3 года назад +1

    @codecat create one video for UITableviewDiffableDatasource and UICollcetionDiffable

  • @rajdhakate617
    @rajdhakate617 2 года назад +1

    I like async await but don’t like the do catch block everywhere

    • @CodeCat15
      @CodeCat15  2 года назад +2

      same here but I think it's a necessary evil to make sure to capture unexpected behavior of the application a tradeoff to live with I guess

  • @buba7456
    @buba7456 3 года назад +1

    Thank u

  • @PankajKumar-vf5xm
    @PankajKumar-vf5xm 2 года назад

    Hello Sir,
    Thanks to you for another nice tutorial.
    I am stuck in my project for making a walkie talkie app. I am unable to awake my application using notifications when app in background or closeed state. Can you please help me. I tried everywhere but no help. Can i contact you by any medium.

  • @z_shawgaming_BGMI
    @z_shawgaming_BGMI 2 года назад

    Bro Push notification pe video banao na

  • @tamminenivenkataramana7120
    @tamminenivenkataramana7120 Год назад

    Please tell me in English

    • @CodeCat15
      @CodeCat15  Год назад

      What's your question? I will be happy to explain it for you.

  • @fitdevelopertv5148
    @fitdevelopertv5148 Год назад +1