Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Even if your cell is actually that simple (background image and label) there are some things to consider</p> <p><strong>Image caching</strong> This is the obvious thing - if you are using the same image everywhere, load it once into the UIImage and reuse it. Even if the system will cache it on its own, directly using the already loaded one should never hurt.</p> <p><strong>Fast calculation</strong> Another rather obvious thing - make calculating height and content as fast as possible. Don't do synchronous fetches (network calls, disk reads etc.).</p> <p><strong>Alpha channel in image</strong> What's expensive when drawing is transparency. As your cell background has nothing behind it, make sure that you save your image without alpha channel. This saves a lot of processing.</p> <p><strong>Transparent label</strong> The same holds true for the label on top of your background view, unfortunately making it opaque might ruin the looks of your cell - but it depends on the image. </p> <p><strong>Custom cell</strong> In general, subclassing <code>UITableViewCell</code> and implementing <code>drawRect:</code> yourself is faster than building the subview hierarchy. You might make your image a class variable that all instances use. In <code>drawRect:</code> you'd draw the image and the text on top of it.</p> <p><strong>Check compositing</strong> The simulator has a tool to highlight the parts that are render-expensive because of transparency (green is ok, red is alpha-blending). It can be found in the debug menu: "Color Blended Layers"</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload