Creating a twitter app in Xcode

Twitter recently introduced display requirements for applications which use the twitter API. Previously there were only guidelines for developers. The display requirements are available at

The tasks required in developing a twitter app include:

1. Using the new Twitter API v1.1 to access tweets
2. Parsing the tweet dictionary to extract the data that is relevant to the app
3. Detecting has tags, user names and web addresses in the tweet as these have special display requirements.
4. Using attributed strings to create the display.
5. Displaying the results in a way that meets twitter’s display requirements.
6. Detecting mouse clicks and taking the appropriate action (retweeting, replying and favouriting need to be available).
7. Dealing with the need for variable tableview heights due the different tweet lengths.

Designing a display that meets Twitter’s new requirements required me to learn or refresh my knowledge of a number of Xcode skills. It also required me to become reasonably familiar with the twitter API. Here is a possibly incomplete list of things that I met during the development of the twitter app.

1. The responder chain for mouse events. NSViews respond to mouse events but cells don’t which makes views easier to use in this case.
2. RegexKitLite. I have never looked much at regular expressions so I am glad that this tool exists to scan strings for various components such as hashtags, twitter usernames and web addresses.
3. Creating mouse tracking areas and changing the cursor when it is within those areas (such as over hashtags etc.).
4. Using twitter web intents for retweeting, favouriting or replying to tweets.
5. Creating an attribute dictionary and adding attributes to certain parts of a string.
6. Parsing the tweet dictionary. I didn’t find a good reference for the structure for the twitter dictionary so worked it out from scratch. This isn’t very hard once you can work out how to access tweets. Retweets present a special problem as long retweets are someimes truncated in one part of the tweet dictionary. The full tweet is available elsewhere in the dictionary however so this problem can be overcome.
7. View based tableviews. I had not used these previously. The default tableview appears to be cell based.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: