Top Tweets for #nscach
I just learned how to download and save images in iOS using FileManager and NSCache. I no longer have to redownload every time. Now I fetch once, cache it in memory, and save it to disk for persistence. This is perfect for speeding up image-heavy apps.
#iOSDev #SwiftLang #Mobile
Herkese Merhaba. Bu sefer iOS uygulama geliştirirken bellek optimizasyonu için kullanIlan NSCache hakkında yazdığım yazıyı sizlerle paylaşmak isterim. Düşüncelerinizi merak ediyorum.
https://t.co/d6YWwzxG9b
Herkese Merhaba. Sizlerle internetten bulduğum veya ChatGPT'den isteğim kodlar üzerinde yaptığım debug işlemler ile ilgili bir medium yazısı paylaşmak isterim. Düşüncelerinizi merakla beklemekteyim. https://t.co/f1u7gE8uh1
Shoutout to @seanallen_dev for helping me learn:
• Custom error message handling
• API calls
• Programmatic UI with NSLayoutConstraint
• Minimizing network calls with NSCache
• Pagination using UIScrollView and UIRefreshControl for infinite scrolling
And much more. 👨🏽💻

Regarding NSCache, is it advisable to set it up as a singleton or best pass around an instance of it?
@PipoEc Huye de Realm y no mires atrás! Lo llevo usando desde hace mucho tiempo y llega un momento que te saltan crashes sin sentido y tampoco te ayudan mucho en el repo... una pista, existe una clase llamada NSCache, lo mismo te sirve 😜
@TheOriginaliTE I just use the defaults. NSCache is pretty smart and usually doesn’t need to be messed with, IMHO.
Hey! I’m using NSCache to store the downloaded images in my SwiftUI app, what do you think should be the totalCostLimit for the cache?
And in general, what according to you would be the optimal memory usage for an app?
@official_JemAl 1. Use NSCache, the system will wipe it out when it’s needed. But NSCache a bit slow because of thread safety
2. Remove images from unused cells. When you scroll and the cell go out of the visible area it will go to reusable pool, but still will keep the image in memory
Most Popular Users

Elon Musk 
@elonmusk
240M followers

Barack Obama 
@barackobama
118.6M followers

Cristiano Ronaldo 
@cristiano
114.4M followers

Donald J. Trump 
@realdonaldtrump
111.7M followers

Narendra Modi 
@narendramodi
106.9M followers

Rihanna 
@rihanna
98.6M followers

NASA 
@nasa
92.1M followers

Justin Bieber 
@justinbieber
91.7M followers

KATY PERRY 
@katyperry
89.9M followers

Taylor Swift 
@taylorswift13
83.9M followers

Lady Gaga 
@ladygaga
75.4M followers

Virat Kohli 
@imvkohli
73.3M followers

Kim Kardashian 
@kimkardashian
70.8M followers

YouTube 
@youtube
68.6M followers

Neymar Jr 
@neymarjr
66.3M followers

Bill Gates 
@billgates
65.2M followers

Selena Gomez 
@selenagomez
63M followers

The Ellen Show
@theellenshow
62.1M followers

CNN 
@cnn
61.7M followers

X 
@x
60.6M followers







