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

How to get the arclen between two curve points in Maya? -

git svn - Unignore directories in git-svn (adding directories to a sparse checkout) -

C++ Linked List -