Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Using a webview per-cell is not going to work as you suspect. Webviews take a noticeable time to render which means you will likely end up with old webview content being momentarily displayed in reused cells until the new content renders. Webview is also a pretty heavy-weight UI element and you will encounter performance issues with having many of them on the screen updating at once.</p> <p>You will want to parse the HTML text you are given into an attributed string using a library like <a href="https://github.com/Cocoanetics/DTCoreText" rel="nofollow">DTCoreText</a>. From here, if you can target iOS 6 or later you can set the <code>attributedText</code> property on a standard <code>UILabel</code>. If you need to target earlier iOS versions you can again use DTCoreText, specifically the <code>DTAttributedLabel</code> or <code>DTAttributedTextCell</code> components.</p> <p>The parsing and <code>NSAttributedString</code> rendering can all be done manually using an XML parser and CoreText, but DTCoreText will make your life much easier.</p> <p>Update: You mentioned in a comment that you want support for <code>&lt;img/&gt;</code>. DTCoreText does have some basic image support, but this is a really hard problem if you are rendering text with CoreText because you have to make text flow around the image correctly, and reserve some space in the core text renderer to put your image into. If there is just a single image for each cell, I would suggest you manually extract the image path/url and lay it out with a <code>UIImageView</code> alongside your text.</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