Swift: Generic & Reusable API Calls (2022, Xcode 12, Swift 5) - iOS Development

Поділитися
Вставка
  • Опубліковано 8 вер 2024
  • In this video we will learn about writing Generic API calls in a reusable fashion. Leveraging generics we can greatly simplify our code and make it highly reusable. We will work with Xcode 12 and Swift 5.
    💻 Source Code: / iosacademy
    🎥 Subscribe for more: www.youtube.co...
    😎 Like my teaching style? Check out some of my most popular courses! courses.iosaca...
    #generics #swift #API
    ** Like my teaching style? Check out some of my most popular courses!
    courses.iosaca...
    Join this channel to get access to perks, code, groups, and more:
    Building Instagram: courses.iosaca...
    Building TikTok: / @iosacademy
    SwiftUI for Beginners: ios-academy.te...
    Join the iOS Academy Community: iosacademy.io/
    ** Get Skillshare free for 2 Months and learn iOS
    www.skillshare...
    ** Manage all your investments from app earnings on Betterment!
    bit.ly/3eBwlI9
    ** Grow your own UA-cam tech channel with TubeBuddy:
    www.tubebuddy....

КОМЕНТАРІ • 71

  • @iOSAcademy
    @iOSAcademy  3 роки тому +7

    If you enjoy my teaching style, check out my courses at courses.iosacademy.io/

  • @dodilodi1278
    @dodilodi1278 3 роки тому +10

    Hi Afraz,
    I have been working with Swift and watching Swift related videos since December 2019.
    Honestly, this is one of the best and most useful videos so far.
    Please make more videos like this, with themes of reusable code because this is one of the most important things for every programmer, I think.
    Thanks!

    • @iOSAcademy
      @iOSAcademy  3 роки тому +3

      Hey, thanks for the feedback! More coning soon

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

    Work wants this done asap. I don't know what I'm doing. You're my only hope to save my job.

  • @acharya-karthikeya
    @acharya-karthikeya Рік тому +1

    Simple example. Excellent explanation. Thanks dude.

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

    Yu amazing..thnx a lot

  • @bunnyrabits
    @bunnyrabits 3 роки тому +3

    Please make a video on how to make secure api calls. Like encrypt data before in the request etc.

  • @rahularora2936
    @rahularora2936 3 роки тому +1

    your a legend. this video helped so much thx

  • @6957-c5k
    @6957-c5k Рік тому

    Nice video. The SRP part is spot on. Although this video is almost a year old, I noticed you didn’t switch threads from background to main thread.

  • @smael1989
    @smael1989 3 роки тому +1

    Wow, thanks! That's great! Never used this

  • @shawnfrank5303
    @shawnfrank5303 3 роки тому

    Really nice to see the power of generics. Wondering if you have any previous videos where you talk about generics as the topic is a bit challenging for me to grasp.

  • @KennyChen0716
    @KennyChen0716 3 роки тому +1

    Love your courses, already bought StockAPP Course. Keeping it Up!!

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

    Nice video!
    Because of you now my knowledge is updated hahaha.
    Oh yea. Btw can you make another video related to Networking again like reusable API for post method(add data to database).
    I'm the first if you upload for post method.
    Thank you very much, Bless u

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

    thank...fantastic content

  • @rev_kous9275
    @rev_kous9275 3 роки тому +1

    Next suggestion: data layer. I think it will be helpful to use them on different view controllers and to have a better scalability to manage data when downloading content and use them. But how to do that, how to implement that ?

  • @jesseyates4473
    @jesseyates4473 3 роки тому +1

    Can you do a video on web scraping API like for Xcode?
    Not many UA-camrs like yourself have videos dedicated to the topic. Plus having you do it means only quality results as your videos leave no stone unturned on how to do Xcodes.
    ps, keep up the good work we all love it.

    • @iOSAcademy
      @iOSAcademy  3 роки тому +2

      Sure! And thanks

    • @jesseyates4473
      @jesseyates4473 3 роки тому

      @@iOSAcademy thanks that’s great I want to figure out how to do use a web scraping API for finding press releases companies or political parties and have it appear to users on Xcode. Maybe even what types of Web Scraping API is out there for the price range.

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

    Fantastic video! Exactly what I was looking for! At 5:30 you are writing the task declaration and remove self from self.dataTask then say this is why we are extending so we don't need a custom class? Can you explain what you mean by that? Is extending only to avoid having to use self?

  • @eldersonlaborit2290
    @eldersonlaborit2290 3 роки тому +1

    hi awesome channel, i want to know, do you have any resource about maps with swift or swiftUI? thanks.

    • @iOSAcademy
      @iOSAcademy  3 роки тому

      Thanks! Yes, search maps on the channwl & youll find losds of videos

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

    Great tutorial. Isn’t possible to reduce the duplicated code on the fetch method?

  • @m3ezzz
    @m3ezzz 3 роки тому +1

    Please make a tutorial for an app utilising dotnet graphql data

  • @raychen4458
    @raychen4458 3 роки тому +1

    Hello sir how does this approach differentiate from using Alamofire ?
    Do you think this way is more convenient to use ?

  • @Portles
    @Portles 3 роки тому +1

    Hi can you show how can I send authorization key in this structure?

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

    Fantastic content. Hi Afraz why don’t you publish new content ? Seems like you are busy now a days. Good luck ! Waiting for something new! 🎉❤

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

    is generic api call helps in displaying different service calls on same viewcontroller at the same time ???? without any flaws?

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

    I feel like the models property is overkill lol. Great video though

  • @obinnaaguwa
    @obinnaaguwa 3 роки тому

    Nice tutorial Boss. can you create an app that can use Apollo GraphQL client to fetch data. Thanks Boss.

  • @AW-gj4ji
    @AW-gj4ji 3 роки тому +1

    This doesn't seem to work for a dictionary. Would anyone know what changes are needed for it?

    • @iOSAcademy
      @iOSAcademy  3 роки тому

      It should work for all types

    • @AW-gj4ji
      @AW-gj4ji 3 роки тому

      @@iOSAcademy I encountered this error while running the same code(but for a different api call).

  • @alirezasoltanineshan2974
    @alirezasoltanineshan2974 3 роки тому +1

    Hi, you are great, but you are super fast in coding as learning section, if you can be slow in your coding, it will be amazing!

  • @imofo
    @imofo 3 роки тому +1

    can you make movie app tutorial pls :3

  • @1988ferry
    @1988ferry 3 роки тому +1

    I am here before 1 mil views

    • @iOSAcademy
      @iOSAcademy  3 роки тому

      Youre the real MVP

    • @1988ferry
      @1988ferry 3 роки тому

      @@iOSAcademy No, you are the MVP, I learned a lot from your channel

  • @markaurelius61
    @markaurelius61 3 роки тому

    So, you are not moving on to async await yet?

    • @iOSAcademy
      @iOSAcademy  3 роки тому +1

      Nope, too new. Waiting for Xcode 13 to be out of beta

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

    Hey man... normally like your content but this flew by and I really didn't learn anything. Warning for those watching this is for advanced users who are able to type REALLY fast.

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

    Well I feel l have wasted my time recreating different methods…

  • @adamshernandez1973
    @adamshernandez1973 3 роки тому +1

    First!! Lol

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

    You need to stop doing all this in a viewController its not good practice or what is used in the real world

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

    Can you speak slower please , you are doing everything so fast , I thought this is learning section but it looks like reminder section:D , thank you!