A lite stripped down version of Facebook's three20 framework
Objective-C Other
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


About This Fork

This fork contains some major changes from the main three20 repository.

  • All sub projects were into a simple project
  • Simplified installation using a CocoaPods (https://github.com/CocoaPods/CocoaPods)
  • XML & JSON extensions merged back to TTNetwork
  • SBSON is linked as a submodule
  • TTExtensionLoader module was removed
  • Removed TTViewController (All view controller implements from UIViewController)
  • Removed YAJL JSON support
  • Removed old xcode templates
  • Appledoc Documentation
  • TTSplitViewController removed
  • TTNaviagtor & url mapping were removed


Three20 is a collection of iPhone UI classes, like a photo viewer, and general utilities, like an HTTP disk cache. Three20 is derived from the Facebook iPhone app, which is one of the most downloaded iPhone apps ever.


You can access Three20 API documentation in several ways:

  1. Online: http://aporat.github.com/three20lite/api
  2. Within Xcode:
    1. Open your Xcode Preferences (⌘,) and switch to Documentation tab.
    2. Click the + button
    3. Add the Three20 doc set feed: feed://aporat.github.com/three20lite/api/com.facebook.Three20.atom
  3. Generate the documentation from the project repository with the src/scripts/docs.py script

An Overview of Three20

Photo Viewer

TTPhotoViewController emulates Apple's Photos app with all of its flick n' pinch delight. You can supply your own "photo sources", which works similiarly to the data sources used by UITableView. Unlike Apple's Photos app, it isn't limited to photos stored locally. Your photos can be loaded from the network, and long lists of photos can be loaded incrementally.

Web image views

TTImageView makes it as easy to display an image as it is in HTML. Just supply the URL of the image, and TTImageView loads it and displays it efficiently. TTImageView also works with the HTTP cache described below to avoid hitting the network when possible.

Internet-aware table view controllers

TTTableViewController and TTTableViewDataSource help you to build tables which load their content from the Internet. Rather than just assuming you have all the data ready to go, like UITableView does by default, TTTableViewController lets you communicate when your data is loading, and when there is an error or nothing to display. It also helps you to add a "More" button to load the next page of data, and optionally supports reloading the data by shaking the device.

Better text fields

TTTextEditor is a UITextView which can grow in height automatically as you type. I use this for entering messages in Facebook Chat, and it behaves similarly to the editor in Apple's SMS app.

TTPickerTextField is a type-ahead UITextField. As you type it searches a data source, and it adds bubbles into the flow of text when you choose a type-ahead option. I use this in TTMessageController for selecting the names of message recipients.

HTTP disk cache

TTURLRequest is a replacement for NSURLRequest which supports a disk cache (NSURLRequest can only cache in RAM). It has some other nice features too. HTTP posts are as easy as supplying a dictionary of parameters. The TTURL loading system can also be suspended and resumed at any time, which is a great performance helper. Network threads often fight with the UI thread, so you can suspend the network any time your app is momentarily graphically intensive.