Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplaying Lots Of RichText : Choosing the best option
    primarykey
    data
    text
    <p><strong>What is the best way to display <em>lots</em> of RichText (HTML formatted)</strong></p> <p>At the moment I'm working on an app for a forum. As you'd expect the posts on the site have lots of HTML formatting, lists, images <strong>bold text</strong>, colored text, etc...</p> <p>Now there are several options I can think of (non of them ideal, please if you think of any other options post them in the comments):</p> <ul> <li><p><strong>Custom Cells using <a href="https://github.com/Cocoanetics/NSAttributedString-Additions-for-HTML" rel="noreferrer">NSAttributedString+HTML</a> + <a href="https://github.com/Cocoanetics/NSAttributedString-Additions-for-HTML/blob/master/Classes/DTAttributedTextView.h" rel="noreferrer">DTAttributedTextView</a> for each post?</strong></p> <p>Problems: I used the NSAttributedString+HTML categories in the app elsewhere and it was less then ideal, creating an NSAttributedString seems to be quite expensive (slow) even in small amounts. For 10+ posts each of which may be the length of an entire article would be awful <strike> + although DTAttributedTextView supports the IMG html tag (an most tags) it doesn't support remote loading of images unless you specify their width and height in the img tag. And for a forum where an IMG tag could be a smiley (10*10) or a screenshot (640*960) there's no way to predict that.</strike> (Since writing this NSAttributedString+HTML, which is now renamed <a href="https://github.com/Cocoanetics/DTCoreText" rel="noreferrer">DTCoreText</a>, has added full support for <code>&lt;img&gt;</code> tags and improved greatly!)</p></li> <li><p><strong>Custom Cells with a UIWebView in them for each post?</strong></p> <p>This one I considered for quite a while, however when reading <a href="http://nickharris.wordpress.com/2010/06/17/fast-uitableviewcell-with-a-uiwebview/" rel="noreferrer">this blog post</a> I realised a problem that would cause, <em>Smooth scrolling</em>. The idea of having a native application for a site is that it is <em>better</em> then using a simple UIWebView to view the sites mobile theme. If the app lags and is jerky while scrolling that is <em>worse</em> not better (also as I need to display images hiding the webview's like he suggests wouldn't work). Also UIWebView's need to be created on the main thread or they break.</p></li> <li><p><strong>Back to the UIWebView?</strong> Annoyingly besides doing a pathetic cheat, (like in the <a href="http://itunes.apple.com/GB/app/id447549423?mt=8&amp;affId=1660407" rel="noreferrer">iFans app</a>) where you only display text and then if they click it a UIWebView loads with all the nice images etc..., the only option left seems to be to do what I think the TapaTalk app does and have the entire thread view as a UIWebView. This isn't <strong>too</strong> bad as it will probably have quite good performance and will allow me to possibly add user controlled themes etc.. but I find the idea of using a UIWebView in a websites <em>native</em> app repulsive.</p></li> </ul> <p>Does anyone have any experience creating web powered app, like <em>maybe</em> a facebook client, forum app, or new site app which had to display content from the site (I don't really count a twitter client as it only has to deal with text &amp; links in small amounts per post). Or any ideas on the best way to display RichText content in an iOS app?</p> <p>Any idea's would have to deal with the lot:</p> <ul> <li>Multi Coloured Text.</li> <li>Right, Left &amp; Center aligned text.</li> <li>Images (of variable size).</li> <li>Bold text.</li> <li>Text of different sizes &amp; fonts.</li> <li>Underlines text.</li> <li>YouTube Videos.</li> <li>HTML tables.</li> </ul> <p><em>Just in case the actual question wasn't very clear in all of that I'll sum it up:</em></p> <p>"<strong>What is the best way to display lots of RichText (HTML formatted) content for a forum client app</strong>"</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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