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

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ก.ค. 2021
  • 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: th-cam.com/users/iOSAcademy?su...
    😎 Like my teaching style? Check out some of my most popular courses! courses.iosacademy.io
    #generics #swift #API
    ** Like my teaching style? Check out some of my most popular courses!
    courses.iosacademy.io
    Join this channel to get access to perks, code, groups, and more:
    Building Instagram: courses.iosacademy.io/p/build...
    Building TikTok: / @iosacademy
    SwiftUI for Beginners: ios-academy.teachable.com/p/s...
    Join the iOS Academy Community: iosacademy.io/
    ** Get Skillshare free for 2 Months and learn iOS
    www.skillshare.com/r/user/afraz
    ** Manage all your investments from app earnings on Betterment!
    bit.ly/3eBwlI9
    ** Grow your own TH-cam tech channel with TubeBuddy:
    www.tubebuddy.com/iosacademy

ความคิดเห็น • 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.

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

  • @acharya-karthikeya
    @acharya-karthikeya ปีที่แล้ว +1

    Simple example. Excellent explanation. Thanks dude.

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

    your a legend. this video helped so much thx

  • @matterologyo_o6842
    @matterologyo_o6842 2 ปีที่แล้ว +1

    Yu amazing..thnx a lot

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

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

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

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

  • @djaircostadev
    @djaircostadev 2 ปีที่แล้ว +1

    thank...fantastic content

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

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

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

  • @gastongasquet3594
    @gastongasquet3594 2 ปีที่แล้ว

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

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

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

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

  • @ProductsHub365
    @ProductsHub365 2 ปีที่แล้ว

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

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

    Can you do a video on web scraping API like for Xcode?
    Not many TH-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.

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

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

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

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

      Alamofire is a lib

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

    Please make a tutorial for an app utilising dotnet graphql data

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

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

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

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

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

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

      Thanks and Yes I can

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

  • @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! 🎉❤

  • @jaylensmith6308
    @jaylensmith6308 ปีที่แล้ว

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

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

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

      Thanks for the feedback

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

    can you make movie app tutorial pls :3

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

    • @iOSAcademy
      @iOSAcademy  ปีที่แล้ว

      Thanks for the feedback

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

    First!! Lol

  • @jaylensmith6308
    @jaylensmith6308 ปีที่แล้ว

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

  • @Derplerplarry
    @Derplerplarry ปีที่แล้ว

    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!

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

      I will try my best