Downloading & Caching Images in iOS with Swift

SdĂ­let
VloĹžit
  • čas přidĂĄn 27. 10. 2020
  • Learn how to use URLSession to download images into a UICollectionView. Then cache those images using an NSCache
    🔗Code:
    github.com/Sam-Meech-Ward/iOS...
    🔗Entire iOS Playlist
    • iOS Development for No...
    🔗Moar Links
    Code Example: github.com/meech-ward/iOS-Ima...
    My Website: www.sammeechward.com
    Instagram: / meech_ward
    Github: github.com/orgs/Sam-Meech-Ward
  • ZĂĄbava

Komentáře • 30

  • @Dragon-yw4xw
    @Dragon-yw4xw Před 2 lety +6

    You deserve more subscribers. This iOS tutorial explained a lot of things. And interviewer will ask these questions.

  • @xxsanyxx1
    @xxsanyxx1 Před 2 lety +2

    Thank you so much for sharing! I've learned so much from your videos. Great explanations and details! I love how you give the reasons why and how to handle certain situations!

  • @ielyax
    @ielyax Před 3 lety +4

    how the hell you only have 800 subscribers??
    This was an extremely amazing tutorial and very well-explained!

  • @Randor10
    @Randor10 Před 3 lety +1

    Thanks for the great explanations of how you handled certain situations and why.

  • @erikkokaev3448
    @erikkokaev3448 Před 2 lety

    Please continue making videos, it really helps. Relevant information is always needed. Thank you

  • @user-yt9uj5oi9d
    @user-yt9uj5oi9d Před rokem

    Excellent tutorial for people who getting iOS-developer interviews!

  • @user-bi7vn6nw9y
    @user-bi7vn6nw9y Před 2 lety +2

    That. Is. Awesome! Really nice video, thank's a lot from Russia!

  • @dinodesa9894
    @dinodesa9894 Před rokem

    Thanks man!

  • @StanislavTerentev
    @StanislavTerentev Před 3 lety

    Thank you very much for this video!

  • @dipikamadan2149
    @dipikamadan2149 Před 2 lety

    Amazing content🤩

  • @arin_faraj
    @arin_faraj Před 2 lety

    Awesome video

  • @dlatechsolutions
    @dlatechsolutions Před rokem

    ÂĄGracias!

  • @markokuncic6189
    @markokuncic6189 Před 2 lety +1

    Would you have an idea how to deal with many rows (e.g. 500+) and fast scrolling? I have the same set up as you and if I scroll fast the app terminates because of memory issues although using NSCaching

  • @vladimirmoor
    @vladimirmoor Před 2 lety

    That "Censored" is the main part of iOS dev work 😁

  • @mandabhaskarkiran9118
    @mandabhaskarkiran9118 Před 2 lety

    hey thanks for the video its really helpful. i have one question "if the image of that url is changed in server, then you you are checking for the url existing in the dictionary. then you wont get the new one right"? Please suggest for that case

  • @Dimension37
    @Dimension37 Před 2 lety

    Hi, nice tutorial btw and all your other video content category is really rare but required topics. Can you direct me to the link where you explain about saving accessKey outside your application ? I am pretty much interested on the right techniques in this concept. Lastly Big Thumbs up for your contents👍

  • @leeroyjenkins5644
    @leeroyjenkins5644 Před 3 lety +1

    Hi Sam, awesome vid!! Could you please leave a link for the resources that show how to hide your api key?

    • @sunnyegbo6252
      @sunnyegbo6252 Před 3 lety

      I, too, am curious to read Sam's suggestions. In the meantime, you might want to read the NSHipster article on this topic here: nshipster.com/secrets/. Sam might have a simpler solution.

  • @iantimmis6213
    @iantimmis6213 Před 3 lety

    Hey Sam, what would your approach be to try and persist that cache of images between sessions? Similar to how if you close Instagram, turn on airplane mode, reopen the app, you will see cached posts/stories.

    • @SamMeechWard
      @SamMeechWard  Před 3 lety +1

      For that you would probably want to store the images in the apps file system and store information about the images in a local database like SQLite. Or more likely use core data.
      I’ve heard that realm is pretty efficient at storing binary objects. I’ve never done this but you could potentially store the images and data about the images in realm objects.
      Basically it’s not an in memory cache anymore, you’ll need to persist any data to the device to access it between sessions

  • @avneetsingh2010
    @avneetsingh2010 Před 3 lety

    Amazing video... Please share your inputs on how to make remote connection to server... I found a library SwiftSH on github but don't how to implement... Your suggestions needed

    • @SamMeechWard
      @SamMeechWard  Před 3 lety

      What are you trying to connect to a remote server for? Usually you would just use ssh in terminal to remotely login to a server from your computer, but HTTP from an iOS app to communicate with the server from the app.

    • @avneetsingh2010
      @avneetsingh2010 Před 3 lety

      @@SamMeechWard Thanks for your quick reply... I am trying to make an iOS app that would connect to remote server and fetch log files and in the backend I want to implement this logic using Swift or Objective C with any SSH Library... Please kindly share any sample code or library that I could use... Thanks in advance!

    • @SamMeechWard
      @SamMeechWard  Před 3 lety

      Fetching a file from a server using ssh and swift is not a very common task and it seems like there would be some security risks unless you setup your linux user correctly.
      It would be easier and probably more secure to make the log files accessible through an http server and have the swift code just make a simple HTTP request for the file. You could use an auth token or username and password to authenticate the user over HTTP. A basic nginx server would do the trick here: docs.nginx.com/nginx/admin-guide/web-server/serving-static-content/
      Or if you prefer programming, you could make an HTTP server in Swift or JavaScript or any language.
      If you do want to it through ssh, which I don't recommend, you'll want to find a library that supports SCP which SwiftSH does not.

  • @aydin_
    @aydin_ Před rokem

    Are someone found links for technics how to keep authorisation token private and secret? Sam talked about it on 3:58

  • @aprilm2941
    @aprilm2941 Před 3 lety

    🤗