Save and cache images in a SwiftUI app | Continued Learning #27

preview_player
Показать описание
In this video we will implement a simple NSCache to temporarily save an image. Caching is a very common technique used in all software development (not just iOS Development) where we can take objects that we've downloaded from the internet and temporarily store them somewhere for reuse. This is help us avoid having to re-download the objects if they appear on the screen a second time. This is quite similar to the last video in this series, except the FileManager is for more permanent objects that will save to the device forever, while NSCache is for temporary objects that will only save for the current session.

In the next video in this series, we develop a real application that efficiently utilizes an NSCache for downloading images!

🤙 WELCOME BACK 🤙

Рекомендации по теме
Комментарии
Автор

I have done all 26 parts of SwiftUI Continued Learning and must say it was an excellent structured and high-quality course. everything worked without hiccups technically. Recommend Nick and his teaching style. #27 is a must :) Best one in this course. Thanks :)

tomb.
Автор

Thank you for such great content . Will there be content on algorithms and their comparison depending on randomness ?

hashcat
Автор

Catching .... LOL Takes me back to Type-Allie-Us ....

comics-on
Автор

Thank you so much Nick. I have a question, is this computed property: "var imageCache: NSCache<NSString, UIImage> = { }()" the same as this one:" var imageCache: NSCache<NSString, UIImage> { }" ? Or what is the difference?

andresraigoza
Автор

Hello Nick, you said that there are third party libraries that will cache much more efficiently. Which one would you recommend?

kevincosta
Автор

Great video man! Would love to know that keyboard you're using, satisfying as hell

jimmyciaston
Автор

Regarding "NS"

"NeXTSTEP was a discontinued object-oriented, multitasking operating system based on the Mach kernel and the UNIX-derived BSD. It was developed by NeXT Computer, founded by Steve Jobs, in the late 1980s and early 1990s and was initially used for its range of proprietary workstation computers such as the NeXTcube."

NotElonMuskk
Автор

This modification will delete the cache when you click on the button.


func removeFromCache() {
infoMessage = manager.remove(name: imageName)
cachedImage = nil
}

josephestrada
Автор

Thank you, i implement this idea in my project

heshamabdo
Автор

Thank you so much, Nick. I have a question. For getFromCache(), due to returnedImage, it does not work properly. When I pressed save, get and remove buttons in order, the image from the cache remains on the screen.

chuljinhwang
Автор

but how can I save images in directory?I mean to show saved images when I re open the app

ciaociccio
Автор

The fact that you kept calling it catch instead of cash is odd hahahaha

noamif