In my article on CoreText I mentioned that Apple left out some very useful methods from NSAttributedString, namely the ones that would allow you to create an attributed string from HTML. Now you would probably not want to create attributed strings from complex HTML documents, but use that for simple tasks like displaying one word in a different color or bold.
My first thought was that maybe I should make it a sellable component, but I dismissed this idea for two reasons:
- there is a certain likelyhood that Apple will implement the missing functions in the next major SDK refresh
- if I would get help from people who are more experienced in dealing with HTML parsing then this would benefit everybody involved
So I posted the question on Twitter as to where to put the shared code. The response was a resounding GitHub (one mention of Mercurial and Assembla each). So far I had put off dealing with GitHub, because – in contrast with many other iOS developers – I happen to very much like Subversion integration in Xcode.
Read on to learn how to get started.