Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 168 lines (130 sloc) 8.979 kb
9c6d6a2 @joehewitt First commit
joehewitt authored
1 Three20
2 =======
3
643ec64 @jverkoey Clean up the README and add community links.
jverkoey authored
4 Three20 is a collection of iPhone UI classes, like a photo viewer, and general
5 utilities, like an HTTP disk cache. Three20 is derived from the
6 [Facebook iPhone app][], which is one of the most downloaded iPhone apps ever.
d7bbd11 @joehewitt * Rename "href" to "url" and "stroke" to "border"
joehewitt authored
7
8 [![](http://farm4.static.flickr.com/3447/3378092101_40a62a04b2_m.jpg)](http://farm4.static.flickr.com/3447/3378092101_b064d8e339_o.jpg)
9 [![](http://farm4.static.flickr.com/3432/3378117315_846547cfba_m.jpg)](http://farm4.static.flickr.com/3432/3378117315_3bf905bdb6_o.jpg)
10 [![](http://farm4.static.flickr.com/3462/3378171111_ec1208541d_m.jpg)](http://farm4.static.flickr.com/3462/3378171111_666173111d_o.jpg)
11 [![](http://farm4.static.flickr.com/3646/3378998444_d0534d337f_m.jpg)](http://farm4.static.flickr.com/3646/3378998444_8d3b1eeef8_o.jpg)
12 [![](http://farm4.static.flickr.com/3552/3378940896_7b23cca98e_m.jpg)](http://farm4.static.flickr.com/3552/3378940896_8ccb5ea1c8_o.jpg)
c25b266 @joehewitt * Update the README with new instructions
joehewitt authored
13 [![](http://farm4.static.flickr.com/3382/3425636810_483f1b65a6_m.jpg)](http://farm4.static.flickr.com/3382/3425636810_b0a578bb22_o.jpg)
d7bbd11 @joehewitt * Rename "href" to "url" and "stroke" to "border"
joehewitt authored
14
643ec64 @jverkoey Clean up the README and add community links.
jverkoey authored
15 Community
16 =========
17
18 If you would like to ask any questions regarding Three20, please check out any of the following:
19
20 * [Three20.info][]
21 * [Three20 Mailing List][]
22 * [Three20 Scope][]
23
d7bbd11 @joehewitt * Rename "href" to "url" and "stroke" to "border"
joehewitt authored
24 Adding Three20 to your project
25 ==============================
26
643ec64 @jverkoey Clean up the README and add community links.
jverkoey authored
27 Three20 is compiled as a static library, and the easiest way to add it to your
28 project is to use Xcode's "dependent project" facilities. Here is how:
29 **Estimated time:** 5 minutes.
d7bbd11 @joehewitt * Rename "href" to "url" and "stroke" to "border"
joehewitt authored
30
621473b @jverkoey Closes #106. Update the README to reference the new repo location.
jverkoey authored
31 1. Clone the three20 git repository: `git clone git://github.com/facebook/three20.git`. Make sure
c2049af @joehewitt * README tweaks
joehewitt authored
32 you store the repository in a permanent place because Xcode will need to reference the files
33 every time you compile your project.
d7bbd11 @joehewitt * Rename "href" to "url" and "stroke" to "border"
joehewitt authored
34
1960191 @jverkoey Update the README to reflect the new project locations.
jverkoey authored
35 2. Locate the "Three20.xcodeproj" file under "`three20/src/Three20/`". Drag Three20.xcodeproj and
643ec64 @jverkoey Clean up the README and add community links.
jverkoey authored
36 drop it onto the root of your Xcode project's "Groups and Files" sidebar. A dialog will
37 appear -- make sure "Copy items" is unchecked and "Reference Type" is "Relative to Project"
1960191 @jverkoey Update the README to reflect the new project locations.
jverkoey authored
38 before clicking "Add".
d7bbd11 @joehewitt * Rename "href" to "url" and "stroke" to "border"
joehewitt authored
39
2e63cc6 @jverkoey Update the README.
jverkoey authored
40 3. Open the Three20 Xcode Project that you just added to your app and expand the "Dependencies"
41 group. Select all of the projects listed there and drag them to your app as well. You should
42 now have the following list of Three20 projects added to your app:
43 * Three20Core
44 * Three20Network
45 * Three20Style
46 * Three20UICommon
47 * Three20UINavigator
48 * Three20UI
49 * Three20
50
51 4. Now you need to link the Three20 static libraries to your project. Select all of the
52 project items that you just added to the sidebar. Under the "Details" table, you will see
53 a number of items, such as libThree20.a and libThree20Core.a. Check the checkbox on the
54 far right for each of the `lib` files (not the UnitTests). This will link each part of the
55 Three20 framework to your app.
56
57 5. Now you need to add Three20 as a dependency of your project, so Xcode compiles it whenever
d7bbd11 @joehewitt * Rename "href" to "url" and "stroke" to "border"
joehewitt authored
58 you compile your project. Expand the "Targets" section of the sidebar and double-click your
59 application's target. Under the "General" tab you will see a "Direct Dependencies" section.
2e63cc6 @jverkoey Update the README.
jverkoey authored
60 Click the "+" button, select "Three20" and each of the other libs, and click "Add Target".
61 You do *not* need to add the `UnitTests` target for each lib.
d7bbd11 @joehewitt * Rename "href" to "url" and "stroke" to "border"
joehewitt authored
62
2e63cc6 @jverkoey Update the README.
jverkoey authored
63 6. Now you need to add the bundle of images and strings to your app. Locate "Three20.bundle" under
20638f8 @joehewitt * Add a missing step to README instructions
joehewitt authored
64 "three20/src" and drag and drop it into your project. A dialog will appear -- make sure
65 "Create Folder References" is selected, "Copy items" is unchecked, and "Reference Type" is
66 "Relative to Project" before clicking "Add".
67
2e63cc6 @jverkoey Update the README.
jverkoey authored
68 7. Now you need to add the Core Animation framework to your project. Right click on the
c25b266 @joehewitt * Update the README with new instructions
joehewitt authored
69 "Frameworks" group in your project (or equivalent) and select Add > Existing Frameworks.
70 Then locate QuartzCore.framework and add it to the project.
71
2e63cc6 @jverkoey Update the README.
jverkoey authored
72 8. Finally, we need to tell your project where to find the Three20 headers. Open your
c2049af @joehewitt * README tweaks
joehewitt authored
73 "Project Settings" and go to the "Build" tab. Look for "Header Search Paths" and double-click
1960191 @jverkoey Update the README to reflect the new project locations.
jverkoey authored
74 it. Add the relative path from your project's directory to the
75 "three20/Build/Products/three20" directory.
7bab43f @joehewitt * Minor code style tweaks and documentation updates
joehewitt authored
76
2e63cc6 @jverkoey Update the README.
jverkoey authored
77 9. While you are in Project Settings, go to "Other Linker Flags" under the "Linker" section, and
d77ad02 @joehewitt * Fix the photo viewer and message composer is iPhone OS 3.0
joehewitt authored
78 add "-ObjC" and "-all_load" to the list of flags.
3274e6d * Update README to make instructions regarding the compiler flags more c...
Joe Hewitt authored
79
2e63cc6 @jverkoey Update the README.
jverkoey authored
80 10. You're ready to go. Just #import "Three20/Three20.h" anywhere you want to use Three20 classes
7bab43f @joehewitt * Minor code style tweaks and documentation updates
joehewitt authored
81 in your project.
d7bbd11 @joehewitt * Rename "href" to "url" and "stroke" to "border"
joehewitt authored
82
643ec64 @jverkoey Clean up the README and add community links.
jverkoey authored
83 An Overview of Three20
84 ======================
d7bbd11 @joehewitt * Rename "href" to "url" and "stroke" to "border"
joehewitt authored
85
86 Photo Viewer
87 ------------
88
643ec64 @jverkoey Clean up the README and add community links.
jverkoey authored
89 [TTPhotoViewController][] emulates Apple's Photos app with all of its flick n' pinch delight.
90 You can supply your own "photo sources", which works similiarly to the data sources used by
91 UITableView. Unlike Apple's Photos app, it isn't limited to photos stored locally. Your
92 photos can be loaded from the network, and long lists of photos can be loaded incrementally.
d7bbd11 @joehewitt * Rename "href" to "url" and "stroke" to "border"
joehewitt authored
93
94 Message composer
95 ----------------
96
643ec64 @jverkoey Clean up the README and add community links.
jverkoey authored
97 [TTMessageController][] emulates the message composer in Apple's Mail app. You can customize it
98 to send any kind of message you want. Include your own set of message fields, or use the
99 standard "To:" and "Subject:". Recipient names can be autocompleted from a data source that
100 you provide.
d7bbd11 @joehewitt * Rename "href" to "url" and "stroke" to "border"
joehewitt authored
101
102 Web image views
103 -----------------------
104
643ec64 @jverkoey Clean up the README and add community links.
jverkoey authored
105 [TTImageView][] makes it as easy to display an image as it is in HTML. Just supply the URL
106 of the image, and TTImageView loads it and displays it efficiently. TTImageView also works
107 with the HTTP cache described below to avoid hitting the network when possible.
d7bbd11 @joehewitt * Rename "href" to "url" and "stroke" to "border"
joehewitt authored
108
109 Internet-aware table view controllers
110 ---------------------------------------
111
643ec64 @jverkoey Clean up the README and add community links.
jverkoey authored
112 [TTTableViewController][] and [TTTableViewDataSource][] help you to build tables which load
113 their content from the Internet. Rather than just assuming you have all the data ready to go,
114 like UITableView does by default, TTTableViewController lets you communicate when your data is
115 loading, and when there is an error or nothing to display. It also helps you to add a "More"
116 button to load the next page of data, and optionally supports reloading the data by shaking the
117 device.
d7bbd11 @joehewitt * Rename "href" to "url" and "stroke" to "border"
joehewitt authored
118
119 Better text fields
120 ------------------
121
643ec64 @jverkoey Clean up the README and add community links.
jverkoey authored
122 [TTTextEditor][] is a UITextView which can grow in height automatically as you type. I use
123 this for entering messages in Facebook Chat, and it behaves similarly to the editor in Apple's
124 SMS app.
d7bbd11 @joehewitt * Rename "href" to "url" and "stroke" to "border"
joehewitt authored
125
643ec64 @jverkoey Clean up the README and add community links.
jverkoey authored
126 [TTPickerTextField][] is a type-ahead UITextField. As you type it searches a data source, and
127 it adds bubbles into the flow of text when you choose a type-ahead option. I use this in
128 TTMessageController for selecting the names of message recipients.
d7bbd11 @joehewitt * Rename "href" to "url" and "stroke" to "border"
joehewitt authored
129
130 HTTP disk cache
131 --------------
132
643ec64 @jverkoey Clean up the README and add community links.
jverkoey authored
133 [TTURLRequest][] is a replacement for NSURLRequest which supports a disk cache (NSURLRequest
134 can only cache in RAM). It has some other nice features too. HTTP posts are as easy as
135 supplying a dictionary of parameters. The TTURL loading system can also be suspended and
136 resumed at any time, which is a great performance helper. Network threads often fight with
137 the UI thread, so you can suspend the network any time your app is momentarily graphically
138 intensive.
d7bbd11 @joehewitt * Rename "href" to "url" and "stroke" to "border"
joehewitt authored
139
140 URL-based Navigation
141 --------------------
142
643ec64 @jverkoey Clean up the README and add community links.
jverkoey authored
143 [TTNavigator][] is for those grizzled old web developers like myself who want to
144 organize their app by "pages" which can be displayed by visiting a URL.
145
146 Your view controllers can simply register URL patterns that they handle, and when those URLs
147 are visited the controllers will be created and displayed. You can also register generic
148 actions that are called when a URL is visited.
d7bbd11 @joehewitt * Rename "href" to "url" and "stroke" to "border"
joehewitt authored
149
1960191 @jverkoey Update the README to reflect the new project locations.
jverkoey authored
150 TTNavigator also persists and restores the full path of navigation controllers and modal
643ec64 @jverkoey Clean up the README and add community links.
jverkoey authored
151 view controllers, so your users can quite the app and come back exactly where they left off.
d7bbd11 @joehewitt * Rename "href" to "url" and "stroke" to "border"
joehewitt authored
152
643ec64 @jverkoey Clean up the README and add community links.
jverkoey authored
153 Learn more at [Three20.info][]
d7bbd11 @joehewitt * Rename "href" to "url" and "stroke" to "border"
joehewitt authored
154
155 [Facebook iPhone app]: http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=284882215&mt=8
643ec64 @jverkoey Clean up the README and add community links.
jverkoey authored
156 [Three20.info]: http://Three20.info
157 [Three20 Mailing List]: http://groups.google.com/group/three20/
158 [Three20 Scope]: http://three20.stackexchange.com
159 [TTPhotoViewController]: http://github.com/facebook/three20/blob/master/src/Three20UI/Headers/TTPhotoViewController.h
160 [TTMessageController]: http://github.com/facebook/three20/blob/master/src/Three20UI/Headers/TTMessageController.h
161 [TTImageView]: http://github.com/facebook/three20/blob/master/src/Three20UI/Headers/TTImageView.h
162 [TTTableViewController]: http://github.com/facebook/three20/blob/master/src/Three20UI/Headers/TTTableViewController.h
163 [TTTableViewDataSource]: http://github.com/facebook/three20/blob/master/src/Three20UI/Headers/TTTableViewDataSource.h
164 [TTURLRequest]: http://github.com/facebook/three20/blob/master/src/Three20Network/Headers/TTURLRequest.h
165 [TTTextEditor]: http://github.com/facebook/three20/blob/master/src/Three20UI/Headers/TTTextEditor.h
166 [TTPickerTextField]: http://github.com/facebook/three20/blob/master/src/Three20UI/Headers/TTPickerTextField.h
167 [TTNavigator]: http://github.com/facebook/three20/blob/master/src/Three20UI/Headers/TTNavigator.h
Something went wrong with that request. Please try again.