Twitter Client

We are going to build a simple Twitter client for displaying the public timeline. We will be using AFNetworking to retrieve our date from the net, and a UITableView to display this data in our app.

   

Let’s start by making a request to the Twitter API and seeing what the response looks like.

If we pull out one entry from the response, we can find the relevant fields for our application.

Let’s build our own dictionary of tweets, stripping out all the data we don’t need.

We can now use our clean dictionary to populate our table view. We’ll set tweet as the main cell text and the user name as the detail text.

AFNetworking also includes a category (more on categories later) for UIImage which adds functionality to load a remote image.

As a final exercise, add a detail view controller to your app that is displayed when a cell is selected. The view should at least contain the tweet and user image of the corresponding cell, and you can also add more information to it if you’d like.

I will provide my sample application at the end of class.

Comments are closed.