Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Fetching latest commit…

Cannot retrieve the latest commit at this time

..
Failed to load latest commit information.
Classes
Configurations
Headers
TTTwitter.xcodeproj
Icon.png
README.mdown
TTTwitter-Info.plist
main.m

README.mdown

TTTwitter Example Project

Version: 1.0

Created by: Jeff Verkoeyen (github.com/jverkoey && @featherless)

Three20 technologies used:

  • TTNavigator - AppDelegate.m
  • TTTableViewController - TTTwitterSearchFeedViewController.m
  • TTTableViewDragRefreshDelegate - TTTwitterSearchFeedViewController.m
  • TTURLRequestModel - TTTwitterSearchFeedModel.h/m
  • TTURLRequest - TTTwitterSearchFeedModel.m
  • TTURLXMLResponse - TTTwitterSearchFeedModel.m
  • TTListDataSource - TTTwitterSearchFeedDataSource.h/m
  • TTStyledText - TTTwitterSearchFeedDataSource.m
  • TTTableStyledTextItem - TTTwitterSearchFeedDataSource.m

Overview

The Twitter example project covers the basics of building a native feed-based iPhone application. This app pulls data from the search.twitter.com feed with the query "three20" and displays the result in a table view.

Cool features

Drag-to-refresh header, as seen in other apps. Simply pull down on the table view to refresh the feed. Thanks to uprise78 for this great addition to the Three20 library!

Architecture

Atlas.h/m - This is where all of the app's navigator routings will go. By placing the URL paths in a central location, we can easily change the URL routings without fear of breaking the app's navigation hierarchy.

AppDelegate.h/m - This is a simple shell for initializing the TTNavigator routes. Nothing crazy going on here.

TTTwitterSearchFeedViewController.h/m - This is where the magic happens in this app. We do two important things here. First, we create the data source. Second, we create a TTTableViewDragRefreshDelegate. The second step is what enables the drag-to-refresh header. Simple, eh?

TTTwitterSearchFeedModel.h/m - The model is what loads the data. In this case we're using a TTURLRequestModel, which is a model that loads its data from a URL request. Before we fire off the request, we also attach the response object, a TTURLXMLResponse, which receives the resulting data and processes it. The Three20 XML parser is incredibly leightweight and simply transforms the XML text into NSObjects. Upon receiving the response, we then enumerate the feed items and create tweets from the objects.

TTTwitterSearchFeedDataSource.h/m - The data source binds the controller to the model. We create the model here as well as defining the text that is displayed when errors occur, or when there aren't any results from the model. When the model completes loading, we take the resulting data and create the table items.

Something went wrong with that request. Please try again.