iOS: Performance of reloading UIImage(name:...) -


i have tableview , each row has icon. 90% of rows have same icon.

in cellforrowatindexpath method load image assets folder this:

var cellimage = uiimage(named: "myimage") 

does pose performance problem? os somehow smart enough it's same image each time? better if loaded image once , saved in class variable , assigned each time?

uiimage's named: api does kind of caching.

if @ uiimage's documentation, states:

use init(named:in:compatiblewith:) method (or init(named:) method) create image image asset or image file located in app’s main bundle (or other known bundle). because these methods cache image data automatically, recommended images use frequently.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

c# SetCompatibleTextRenderingDefault must be called before the first -