I'm creating an app where each user has a profile image that is around 30 kb. However i'm now quite sure what is the best way to store these images, i could store them in my realm object as NSData
, but i guess this is not ideal. Otherwise i could save in Disk cache or Memory Cache, but what is the ideal way to do it here? i am using AlamofireImage for downloading images.
I use SDWebImage that stores images in memory/disk, one can cache image manually in image cache or it also has extension to set image via URL for UIImageView, so it downloads and caches image automatically (and call completion block if you want). It clears images those old (say a week old), or you can clear cache manually. Kingfisher is also great and written in swift.