The NSAttributed string additions available on the Mac allowing one to easily display properly formatted HTML text do not as of yet exist for iOS devices.
Because of this in order to display rich HTML text we need to use a UIWebview, and apart from being somewhat inconvenient this can bring about other problems. Fortunately Oliver Drobnik from Cocoanetics has created an open source library duplicating the html related NSAttributedString methods available on the Mac.
The library utilizes core text, and Oliver has done a brilliant job of mimicking Apple’s NSAttributedString functionality with tremendous precision. Not all tags are supported so not all HTML will display straight out, but many are available.
The library along with information on supported tags can be found on Github here:
NSAttributed String Additions For HTML
You can find Oliver’s original writeup on the library here:
UIWebView Must Die
Definitely a very useful library for displaying something such as a credits or instruction page within an iOS app.
©2011 iPhone, iOS 4, iPad SDK Development Tutorial and Programming Tips. All Rights Reserved.
.





