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

Поділитися
Вставка
  • Опубліковано 18 лис 2024

КОМЕНТАРІ • 31

  • @tomb.6995
    @tomb.6995 Рік тому +6

    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 :)

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

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

  • @NotElonMuskk
    @NotElonMuskk 2 місяці тому

    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."

  • @thaisfernandes7498
    @thaisfernandes7498 3 місяці тому

    Thanksss! Your videos are amazing

  • @comics-on
    @comics-on 2 роки тому +3

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

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

      lol indices

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

      @@andrewli1455 Well you could always Catch in Dices...but what would you have?😁

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

    Swift UI God❤️😎

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

    Thanks for sharing video~~
    Amazing~~

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

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

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

      This was 2019 MacBook Pro before they changed the keyboard 😰

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

      @@SwiftfulThinking ugh the good old days haha thanks man for all your videos. Sincerely appreciate the content

  • @josephestrada4222
    @josephestrada4222 7 місяців тому +1

    This modification will delete the cache when you click on the button.
    func removeFromCache() {
    infoMessage = manager.remove(name: imageName)
    cachedImage = nil
    }

  • @kevincosta2132
    @kevincosta2132 10 місяців тому

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

    • @SwiftfulThinking
      @SwiftfulThinking  10 місяців тому +4

      I’m gunna make videos on these soon, but in order:
      1. SDWebImageSwiftUI
      2. Kingfisher
      3. NukeUI

    • @kevincosta2132
      @kevincosta2132 10 місяців тому

      Thank you very much, best content creator like always!@@SwiftfulThinking

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

    Thank you , i implement this idea in my project

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

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

    • @SwiftfulThinking
      @SwiftfulThinking  2 роки тому +2

      We use the () to call the initializer to actually create the object

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

    Great video!

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

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

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

    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.

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

      Chuljin, this is because of your getFromCache(). When you added the “if let” to safely unwrap the optional, you got rid of the nil.
      So, instead of “cacheImage” = nil, it will still = the last image.
      If Nick were to try to remove the image from the canvas again at the end of the video, it wouldn’t work for him either.
      If you want to have same effect, set cachedImage to nil like so
      …} else {
      cachedImage = nil
      infoMessage = “Not found in cache”
      }

    • @1slyboy
      @1slyboy Рік тому

      Modify the getFromCache else class to set cachedImage back to nil. Then when you get the image again and it is not found, the UI will remove the image from the screen.

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

    thanks again happy to have done all

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

    Thanks Nick

  • @noamif
    @noamif 2 роки тому +2

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