Downloading & Caching Images in iOS with Swift
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
You deserve more subscribers. This iOS tutorial explained a lot of things. And interviewer will ask these questions.
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!
how the hell you only have 800 subscribers??
This was an extremely amazing tutorial and very well-explained!
Thanks for the great explanations of how you handled certain situations and why.
Please continue making videos, it really helps. Relevant information is always needed. Thank you
Excellent tutorial for people who getting iOS-developer interviews!
That. Is. Awesome! Really nice video, thank's a lot from Russia!
Thank you from Canadađ¤
Thanks man!
Thank you very much for this video!
đ¤
Amazing contentđ¤Š
Awesome video
ÂĄGracias!
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
That "Censored" is the main part of iOS dev work đ
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
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đ
Hi Sam, awesome vid!! Could you please leave a link for the resources that show how to hide your api key?
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.
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.
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
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
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.
@@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!
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.
Are someone found links for technics how to keep authorisation token private and secret? Sam talked about it on 3:58
đ¤
đ¤