Progress…
Here are screen shots of the first couple of screens from the Todoist app. I am trying to keep the look of the main site, whilst following the iPhone style.
Projects
Loading Screen
Here are screen shots of the first couple of screens from the Todoist app. I am trying to keep the look of the main site, whilst following the iPhone style.
Projects
Loading Screen
I had a major problem with trying to render the contents of the item details. The problem comes with the different formatting that you can apply to each section. Each item can have labels, which in Todoist are formatted green, and then the main content can have formatting applied to it. It can have bold, italic, underline, highlighted and hyperlinks.
The iPhone SDK has no single control which can take formatted text, except for the UIWebView, which takes fully formatted HTML. Using these will bring in all of the WebKit, which turns out to be far too heavyweight. This always was Apples prescribed method is to display formatted text, but it is just too sluggish. The scrolling is very slow and makes it feel like you are dragging your view through treacle.
Fortunately, there is a better way.
I found this post by Loren Brichter from Atebits.com, who wrote the Tweetie Twitter client. He dictates that the fastest way to render a table view is to custom render each cell. This is OK with blocks of text, but it comes a bit more difficult when you have to render different formatted text in the middle of a block.
My solution is to break the the content down into individual words, and calculate the formatting you want applied to that and then render each word in its place.
Rendering text with formatting
As this picture shows, I may have gone a bit over the top, but the delay in rendering the cell (and you have to calculate the space twice. Once for the cell height, and a second time for the actual drawing) was very minimal.
There is an overhead on processing the text passed in as you have to parse it to interpret where the formatting is to be placed, but once this is done it is lightening quick.
I plan to try and get this working much smoother and optimise it more to get it as smooth as possible, but I am very happy with this first attempt.
If people are interested, then I may throw together an example of how I am actually doing this, but I would have struggled if it were not for Loren Brichters initial example.
It now turns out that Apple has extended its TableSuite examples to include a version which custom renders using this method. Personally, I don’t see any other method of doing this.
I am currently developing an iPhone app for the Todoist.com web site. This is my first iPhone app, and I have had to restart the application 3 times now. The key is in the custom rendering of the table view cells.
I will post progress now as and when I make it.