Skip to content
Browse files

* Rename "href" to "url" and "stroke" to "border"

* Add documentation for how to add Three20 to your project
  • Loading branch information...
1 parent dd31651 commit d7bbd117ea798f3dc134edca8b64d92c37d2bad3 @joehewitt joehewitt committed
View
100 README.mdown
@@ -1,4 +1,102 @@
Three20
=======
-Three20 is an iPhone UI library.
+Three20 is an Objective-C library for iPhone developers containing UI classes, like a photo viewer, and general utilities, like an HTTP disk cache.
+
+[![](http://farm4.static.flickr.com/3447/3378092101_40a62a04b2_m.jpg)](http://farm4.static.flickr.com/3447/3378092101_b064d8e339_o.jpg)
+[![](http://farm4.static.flickr.com/3432/3378117315_846547cfba_m.jpg)](http://farm4.static.flickr.com/3432/3378117315_3bf905bdb6_o.jpg)
+[![](http://farm4.static.flickr.com/3462/3378171111_ec1208541d_m.jpg)](http://farm4.static.flickr.com/3462/3378171111_666173111d_o.jpg)
+[![](http://farm4.static.flickr.com/3646/3378998444_d0534d337f_m.jpg)](http://farm4.static.flickr.com/3646/3378998444_8d3b1eeef8_o.jpg)
+[![](http://farm4.static.flickr.com/3552/3378940896_7b23cca98e_m.jpg)](http://farm4.static.flickr.com/3552/3378940896_8ccb5ea1c8_o.jpg)
+[![](http://farm4.static.flickr.com/3592/3378941824_2fab2317c7_m.jpg)](http://farm4.static.flickr.com/3592/3378941824_6b7928e391_o.jpg)
+
+Adding Three20 to your project
+==============================
+
+Three20 is compiled as a static library, and the easiest way to add it to your project is to use Xcode's "dependent project" facilities. Here is how:
+
+1. Clone the three20 git repository: `git clone git://github.com/joehewitt/three20.git`
+
+ Make sure you store the repository in a permanent place because Xcode will need
+ to reference the files every time you compile your project.
+
+2. Locate the "Three20.xcodeproj" file under three20/src. Drag Three20.xcodeproj and drop it onto
+ the root of your Xcode project's "Groups and Files" sidebar. A dialog will appear -- make sure
+ "Copy items" is unchecked and "Reference Type" is "Relative to Project" and then click "Add".
+
+3. Now you need to link the Three20 static library to your project. Click the "Three20.xcodeproj"
+ item that has just been added to the sidebar. Under the "Details" table, you will see a single
+ item: libThree20.a. Check the checkbox on the far right of libThree20.a.
+
+4. Now we need to add Three20 as a dependency of your project, so Xcode compiles it whenever
+ you compile your project. Expand the "Targets" section of the sidebar and double-click your
+ application's target. Under the "General" tab you will see a "Direct Dependencies" section.
+ Click the "+" button, select "Three20", and click "Add Target".
+
+5. Finally, we need to tell your project where to find the Three20 headers. Open your
+ "Project Settings" and go to the "Build" tab. Look for "Header Search Paths" and double-click
+ it. Add the relative path from your project's directory to the "three20/src" directory.
+
+What's in 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. This version is also better than the one in the shipping Facebook app because it supports zooming.
+
+Message composer
+----------------
+
+[TTMessageController][] emulates the message composer in Apple's Mail app. You can customize it to send any kind of message you want. Include your own set of message fields, or use the standard "To:" and "Subject:". Recipient names can be autocompleted from a data source that you provide.
+
+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.
+
+URL-based Navigation
+--------------------
+
+[TTNavigationCenter][] is for those grizzled old web developers like myself who want to organize their app by "pages" which can be displayed by visiting a URL.
+
+Your view controllers can simply register URL patterns that they handle, and when those URLs are visited the controllers will be created and displayed. You can also register generic actions that are called when a URL is visited.
+
+TTNavigationCenter also persists and restores the full path of navigation controllers and modal view controllers, so your users can quite the app and come back exactly where they left off.
+
+[Facebook Connect for iPhone]: http://developers.facebook.com/connect_iphone.php
+[Five months ago]: http://joehewitt.com/post/developing-facebook-for-iphone/
+[Facebook iPhone app]: http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=284882215&mt=8
+[Three20]: http://github.com/joehewitt/three20/
+[hosted on github]: http://github.com/joehewitt/three20/
+[TTPhotoViewController]: http://github.com/joehewitt/three20/blob/master/src/Three20/TTPhotoViewController.h
+[TTMessageController]: http://github.com/joehewitt/three20/blob/master/src/Three20/TTMessageController.h
+[TTImageView]: http://github.com/joehewitt/three20/blob/master/src/Three20/TTImageView.h
+[TTTableViewController]: http://github.com/joehewitt/three20/blob/master/src/Three20/TTTableViewController.h
+[TTTableViewDataSource]: http://github.com/joehewitt/three20/blob/master/src/Three20/TTTableViewDataSource.h
+[TTActivityLabel]: http://github.com/joehewitt/three20/blob/master/src/Three20/TTActivityLabel.h
+[TTShinyLabel]: http://github.com/joehewitt/three20/blob/master/src/Three20/TTShinyLabel.h
+[TTURLRequest]: http://github.com/joehewitt/three20/blob/master/src/Three20/TTURLRequest.h
+[TTBackgroundView]: http://github.com/joehewitt/three20/blob/master/src/Three20/TTBackgroundView.h
+[TTAppearance]: http://github.com/joehewitt/three20/blob/master/src/Three20/TTAppearance.h
+[UIColor]: http://github.com/joehewitt/three20/blob/master/src/Three20/UIColorAdditions.h
+[TTTextEditor]: http://github.com/joehewitt/three20/blob/master/src/Three20/TTTextEditor.h
+[TTPickerTextField]: http://github.com/joehewitt/three20/blob/master/src/Three20/TTPickerTextField.h
+[TTNavigationCenter]: http://github.com/joehewitt/three20/blob/master/src/Three20/TTNavigationCenter.h
View
2 project.dev
@@ -1,3 +1,3 @@
name = "Three20"
-description = "Three20 iPhone Framework"
+description = "Three20 iPhone library"
View
2 samples/TTCatalog/Classes/ImageTest2Controller.m
@@ -7,7 +7,7 @@ @implementation ImageTest2Controller
// private
- (TTImageTableField*)fieldForURL:(NSString*)url {
- return [[[TTIconTableField alloc] initWithText:@"Table Row" href:nil image:url
+ return [[[TTIconTableField alloc] initWithText:@"Table Row" url:nil image:url
defaultImage:[UIImage imageNamed:@"DefaultAlbum.png"]] autorelease];
}
View
2 samples/TTCatalog/Classes/MessageTestController.m
@@ -22,7 +22,7 @@ - (void)dealloc {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)compose {
- id recipient = [[[TTTableField alloc] initWithText:@"Alan Jones" href:TT_NULL_URL] autorelease];
+ id recipient = [[[TTTableField alloc] initWithText:@"Alan Jones" url:TT_NULL_URL] autorelease];
TTMessageController* controller = [[[TTMessageController alloc]
initWithRecipients:[NSArray arrayWithObject:recipient]] autorelease];
controller.dataSource = _dataSource;
View
4 samples/TTCatalog/Classes/MockDataSource.m
@@ -364,7 +364,7 @@ - (void)tableView:(UITableView*)tableView search:(NSString*)text {
text = [text lowercaseString];
for (NSString* name in _names) {
if ([[name lowercaseString] rangeOfString:text].location == 0) {
- TTTableField* field = [[[TTTableField alloc] initWithText:name href:TT_NULL_URL]
+ TTTableField* field = [[[TTTableField alloc] initWithText:name url:TT_NULL_URL]
autorelease];
[_items addObject:field];
}
@@ -388,7 +388,7 @@ - (void)rebuildItems {
[map setObject:section forKey:letter];
}
- TTTableField* field = [[[TTTableField alloc] initWithText:name href:TT_NULL_URL] autorelease];
+ TTTableField* field = [[[TTTableField alloc] initWithText:name url:TT_NULL_URL] autorelease];
[section addObject:field];
}
View
2 samples/TTCatalog/Classes/PhotoTest1Controller.m
@@ -36,7 +36,7 @@ - (void)viewDidLoad {
caption:@"These are the wood tiles that we had installed after the accident."] autorelease],
// Causes album to be loaded
- [NSNull null],
+// [NSNull null],
[[[MockPhoto alloc]
initWithURL:@"http://farm2.static.flickr.com/1124/3164979509_bcfdd72123.jpg?v=0"
View
39 samples/TTCatalog/Classes/RootViewController.m
@@ -47,8 +47,7 @@ - (void)viewDidLoad {
[nav addView:@"activityTest" controller:[ActivityTestController class]];
[nav addView:@"scrollViewTest" controller:[ScrollViewTestController class]];
- [self validateView];
-
+// [self validateView];
// NSIndexPath* indexPath = [NSIndexPath indexPathForRow:1 inSection:2];
// [self.tableView touchRowAtIndexPath:indexPath animated:NO];
}
@@ -60,35 +59,35 @@ - (void)viewDidLoad {
return [TTSectionedDataSource dataSourceWithObjects:
@"Photos",
[[[TTTableField alloc] initWithText:@"Photo Browser"
- href:@"tt://photoTest1"] autorelease],
+ url:@"tt://photoTest1"] autorelease],
[[[TTTableField alloc] initWithText:@"Photo Thumbnails"
- href:@"tt://photoTest2"] autorelease],
-
- @"Tables",
- [[[TTTableField alloc] initWithText:@"Table States"
- href:@"tt://tableTest"] autorelease],
- [[[TTTableField alloc] initWithText:@"Table Cells"
- href:@"tt://tableFieldTest"] autorelease],
- [[[TTTableField alloc] initWithText:@"Web Images in Table"
- href:@"tt://imageTest2"] autorelease],
+ url:@"tt://photoTest2"] autorelease],
@"Text",
[[[TTTableField alloc] initWithText:@"Composer"
- href:@"tt://composerTest"] autorelease],
+ url:@"tt://composerTest"] autorelease],
[[[TTTableField alloc] initWithText:@"Search Bar"
- href:@"tt://searchTest"] autorelease],
+ url:@"tt://searchTest"] autorelease],
[[[TTTableField alloc] initWithText:@"Activity Labels"
- href:@"tt://activityTest"] autorelease],
+ url:@"tt://activityTest"] autorelease],
+
+ @"Tables",
+ [[[TTTableField alloc] initWithText:@"Table States"
+ url:@"tt://tableTest"] autorelease],
+ [[[TTTableField alloc] initWithText:@"Table Cells"
+ url:@"tt://tableFieldTest"] autorelease],
+ [[[TTTableField alloc] initWithText:@"Web Images in Table"
+ url:@"tt://imageTest2"] autorelease],
@"Views",
[[[TTTableField alloc] initWithText:@"Tab Bars"
- href:@"tt://tabBarTest"] autorelease],
- [[[TTTableField alloc] initWithText:@"Web Image"
- href:@"tt://imageTest1"] autorelease],
+ url:@"tt://tabBarTest"] autorelease],
[[[TTTableField alloc] initWithText:@"YouTube Player"
- href:@"tt://youTubeTest"] autorelease],
+ url:@"tt://youTubeTest"] autorelease],
+ [[[TTTableField alloc] initWithText:@"Web Image"
+ url:@"tt://imageTest1"] autorelease],
[[[TTTableField alloc] initWithText:@"Scroll View"
- href:@"tt://scrollViewTest"] autorelease],
+ url:@"tt://scrollViewTest"] autorelease],
nil];
}
View
2 samples/TTCatalog/Classes/ScrollViewTestController.m
@@ -51,7 +51,7 @@ - (UIView*)scrollView:(TTScrollView*)scrollView pageAtIndex:(NSInteger)pageIndex
pageView = [[[TTBackgroundView alloc] initWithFrame:CGRectZero] autorelease];
pageView.style = TTDrawFillRect;
pageView.backgroundInset = UIEdgeInsetsMake(10, 10, 10, 10);
- pageView.strokeRadius = 30;
+ pageView.borderRadius = 30;
pageView.strokeColor = [UIColor blueColor];
pageView.fillColor2 = [UIColor colorWithRed:1 green:1 blue:1 alpha:1];
pageView.backgroundColor = [UIColor clearColor];
View
16 samples/TTCatalog/Classes/TableFieldTestController.m
@@ -37,21 +37,23 @@ - (void)loadView {
// TTTableViewController
- (id<TTTableViewDataSource>)createDataSource {
+ // This demonstrates how to create a table with standard table "fields". Many of these
+ // fields with URLs that will be visited when the row is selected
return [TTSectionedDataSource dataSourceWithObjects:
@"Buttons",
[[[TTTableField alloc] initWithText:@"TTTableField"
- href:@"tt://tableFieldTest"] autorelease],
- [[[TTTableField alloc] initWithText:@"TTTableField (external)"
- href:@"http://foo.com"] autorelease],
+ url:@"tt://tableFieldTest"] autorelease],
+ [[[TTTableField alloc] initWithText:@"TTTableField (external link)"
+ url:@"http://foo.com"] autorelease],
[[[TTLinkTableField alloc] initWithText:@"TTLinkTableField"
- href:@"tt://tableFieldTest"] autorelease],
- [[[TTIconTableField alloc] initWithText:@"TTIconTableField" href:@"tt://tableFieldTest"
+ url:@"tt://tableFieldTest"] autorelease],
+ [[[TTIconTableField alloc] initWithText:@"TTIconTableField" url:@"tt://tableFieldTest"
image:@"bundle://tableIcon.png" ] autorelease],
- [[[TTImageTableField alloc] initWithText:@"TTImageTableField" href:@"tt://tableFieldTest"
+ [[[TTImageTableField alloc] initWithText:@"TTImageTableField" url:@"tt://tableFieldTest"
image:@"bundle://person.jpg"] autorelease],
[[[TTButtonTableField alloc] initWithText:@"TTButtonTableField"] autorelease],
[[[TTTitledTableField alloc] initWithTitle:@"title"
- text:@"TTTitledTableField" href:@"tt://tableFieldTest"] autorelease],
+ text:@"TTTitledTableField" url:@"tt://tableFieldTest"] autorelease],
[[[TTMoreButtonTableField alloc] initWithText:@"TTMoreButtonTableField"
subtitle:@"Showing 1 of 100"] autorelease],
View
11 samples/TTCatalog/Classes/YouTubeTestController.m
@@ -12,8 +12,17 @@ - (void)loadView {
self.view.backgroundColor = [UIColor redColor];
youTubeView = [[TTYouTubeView alloc] initWithURL:@"http://www.youtube.com/watch?v=g8thp78oXsg"];
- youTubeView.center = CGPointMake(self.view.width/2, 100);
+ youTubeView.center = CGPointMake(self.view.width/2, 150);
[self.view addSubview:youTubeView];
+
+ UILabel* label = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease];
+ label.text = @"TTYouTubeView does not work in the iPhone Simulator";
+ label.frame = CGRectMake(10, 10, 300, 30);
+ label.backgroundColor = [UIColor redColor];
+ label.textColor = [UIColor whiteColor];
+ label.font = [UIFont boldSystemFontOfSize:11];
+ label.textAlignment = UITextAlignmentCenter;
+ [self.view addSubview:label];
}
///////////////////////////////////////////////////////////////////////////////////////////////////
View
4 src/TTActivityLabel.m
@@ -48,13 +48,13 @@ - (id)initWithFrame:(CGRect)frame style:(TTActivityLabelStyle)style text:(NSStri
_bezelView.opaque = NO;
_bezelView.style = TTDrawFillRect;
_bezelView.fillColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.7];
- _bezelView.strokeRadius = 10;
+ _bezelView.borderRadius = 10;
} else if (_style == TTActivityLabelStyleWhiteBezel) {
_bezelView.opaque = NO;
_bezelView.style = TTDrawFillRect;
_bezelView.fillColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:1];
_bezelView.strokeColor = [UIColor colorWithRed:0.7 green:0.7 blue:0.7 alpha:1];
- _bezelView.strokeRadius = 10;
+ _bezelView.borderRadius = 10;
} else if (_style == TTActivityLabelStyleWhiteBox) {
_bezelView.backgroundColor = [UIColor whiteColor];
self.backgroundColor = [UIColor whiteColor];
View
10 src/TTBackgroundView.m
@@ -5,7 +5,7 @@
@implementation TTBackgroundView
@synthesize style = _style, fillColor = _fillColor, fillColor2 = _fillColor2,
- strokeColor = _strokeColor, strokeRadius = _strokeRadius, backgroundInset = _backgroundInset;
+ strokeColor = _strokeColor, borderRadius = _borderRadius, backgroundInset = _backgroundInset;
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -15,7 +15,7 @@ - (id)initWithFrame:(CGRect)frame {
_fillColor = nil;
_fillColor2 = nil;
_strokeColor = nil;
- _strokeRadius = 0;
+ _borderRadius = 0;
_backgroundInset = UIEdgeInsetsZero;
self.contentMode = UIViewContentModeRedraw;
}
@@ -42,13 +42,13 @@ - (void)drawRect:(CGRect)rect {
if (_fillColor2 && _fillColor) {
UIColor* fillColors[] = {_fillColor, _fillColor2};
[[TTAppearance appearance] draw:_style rect:frame fill:fillColors fillCount:2
- stroke:_strokeColor radius:_strokeRadius];
+ stroke:_strokeColor radius:_borderRadius];
} else if (_fillColor) {
[[TTAppearance appearance] draw:_style rect:frame fill:&_fillColor fillCount:1
- stroke:_strokeColor radius:_strokeRadius];
+ stroke:_strokeColor radius:_borderRadius];
} else {
[[TTAppearance appearance] draw:_style rect:frame fill:nil fillCount:0
- stroke:_strokeColor radius:_strokeRadius];
+ stroke:_strokeColor radius:_borderRadius];
}
}
}
View
20 src/TTLinkView.m
@@ -6,12 +6,12 @@
@implementation TTLinkView
-@synthesize delegate = _delegate, href = _href, borderRadius = _borderRadius;
+@synthesize delegate = _delegate, url = _url, borderRadius = _borderRadius;
- (id)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
_delegate = nil;
- _href = nil;
+ _url = nil;
_screenView = nil;
_borderRadius = 4;
@@ -22,7 +22,7 @@ - (id)initWithFrame:(CGRect)frame {
}
- (void)dealloc {
- [_href release];
+ [_url release];
[_screenView release];
[super dealloc];
}
@@ -33,11 +33,11 @@ - (void)tapped {
BOOL okToDispatch = YES;
if ([_delegate respondsToSelector:@selector(linkVisited:link:animated:)]) {
okToDispatch = (BOOL)(int)[_delegate performSelector:@selector(linkVisited:link:animated:)
- withObject:_href withObject:self withObject:(id)(int)YES];
+ withObject:_url withObject:self withObject:(id)(int)YES];
}
if (okToDispatch) {
- [[TTNavigationCenter defaultCenter] displayObject:_href];
+ [[TTNavigationCenter defaultCenter] displayObject:_url];
}
}
@@ -69,7 +69,7 @@ - (void)setHighlighted:(BOOL)highlighted {
}
if (highlighted) {
- _screenView.strokeRadius = _borderRadius;
+ _screenView.borderRadius = _borderRadius;
_screenView.frame = self.bounds;
_screenView.hidden = NO;
} else {
@@ -79,11 +79,11 @@ - (void)setHighlighted:(BOOL)highlighted {
///////////////////////////////////////////////////////////////////////////////////////////////////
-- (void)setHref:(id)href {
- [_href release];
- _href = [href retain];
+- (void)setURL:(id)url {
+ [_url release];
+ _url = [url retain];
- self.userInteractionEnabled = !!_href;
+ self.userInteractionEnabled = !!_url;
}
@end
View
33 src/TTTableField.m
@@ -4,12 +4,12 @@
@implementation TTTableField
-@synthesize text = _text, href = _href;
+@synthesize text = _text, url = _url;
- (id)init {
if (self = [super init]) {
_text = nil;
- _href = nil;
+ _url = nil;
}
return self;
}
@@ -21,17 +21,10 @@ - (id)initWithText:(NSString*)text {
return self;
}
-- (id)initWithText:(NSString*)text href:(NSString*)href {
+- (id)initWithText:(NSString*)text url:(NSString*)url {
if (self = [self init]) {
self.text = text;
- self.href = href;
- }
- return self;
-}
-
-- (id)initWithHref:(NSString*)href {
- if (self = [self init]) {
- self.href = href;
+ self.url = url;
}
return self;
}
@@ -42,7 +35,7 @@ - (NSString*)description {
- (void)dealloc {
[_text release];
- [_href release];
+ [_url release];
[super dealloc];
}
@@ -121,8 +114,8 @@ - (id)initWithTitle:(NSString*)title text:(NSString*)text {
return self;
}
-- (id)initWithTitle:(NSString*)title text:(NSString*)text href:(NSString*)href {
- if (self = [self initWithText:text href:href]) {
+- (id)initWithTitle:(NSString*)title text:(NSString*)text url:(NSString*)url {
+ if (self = [self initWithText:text url:url]) {
self.title = title;
}
return self;
@@ -155,8 +148,8 @@ - (id)initWithText:(NSString*)text subtext:(NSString*)subtext {
return self;
}
-- (id)initWithText:(NSString*)text subtext:(NSString*)subtext href:(NSString*)href {
- if (self = [self initWithText:text href:href]) {
+- (id)initWithText:(NSString*)text subtext:(NSString*)subtext url:(NSString*)url {
+ if (self = [self initWithText:text url:url]) {
self.subtext = subtext;
}
return self;
@@ -183,17 +176,17 @@ - (id)init {
return self;
}
-- (id)initWithText:(NSString*)text href:(NSString*)href image:(NSString*)icon
+- (id)initWithText:(NSString*)text url:(NSString*)url image:(NSString*)icon
defaultImage:(UIImage*)image {
- if (self = [super initWithText:text href:href]) {
+ if (self = [super initWithText:text url:url]) {
self.image = icon;
self.defaultImage = image;
}
return self;
}
-- (id)initWithText:(NSString*)text href:(NSString*)href image:(NSString*)image {
- return [self initWithText:text href:href image:image defaultImage:nil];
+- (id)initWithText:(NSString*)text url:(NSString*)url image:(NSString*)image {
+ return [self initWithText:text url:url image:image defaultImage:nil];
}
- (void)dealloc {
View
12 src/TTTableFieldCell.m
@@ -78,8 +78,8 @@ - (void)setObject:(id)object {
_label.text = _field.text;
- if (_field.href) {
- if ([[TTNavigationCenter defaultCenter] urlIsSupported:_field.href]) {
+ if (_field.url) {
+ if ([[TTNavigationCenter defaultCenter] urlIsSupported:_field.url]) {
self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
} else {
self.accessoryType = UITableViewCellAccessoryNone;
@@ -253,8 +253,8 @@ - (void)setObject:(id)object {
_label.lineBreakMode = UILineBreakModeWordWrap;
_label.numberOfLines = 0;
- if (field.href) {
- if ([[TTNavigationCenter defaultCenter] urlIsSupported:field.href]) {
+ if (field.url) {
+ if ([[TTNavigationCenter defaultCenter] urlIsSupported:field.url]) {
self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
} else {
self.accessoryType = UITableViewCellAccessoryNone;
@@ -346,8 +346,8 @@ - (void)setObject:(id)object {
_subtextLabel.text = field.subtext;
- if (field.href) {
- if ([[TTNavigationCenter defaultCenter] urlIsSupported:field.href]) {
+ if (field.url) {
+ if ([[TTNavigationCenter defaultCenter] urlIsSupported:field.url]) {
self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
} else {
self.accessoryType = UITableViewCellAccessoryNone;
View
4 src/TTTableViewController.m
@@ -57,8 +57,8 @@ - (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)
id object = [dataSource tableView:tableView objectForRowAtIndexPath:indexPath];
if ([object isKindOfClass:[TTTableField class]]) {
TTTableField* field = object;
- if (field.href) {
- [[TTNavigationCenter defaultCenter] displayURL:field.href];
+ if (field.url) {
+ [[TTNavigationCenter defaultCenter] displayURL:field.url];
}
if ([field isKindOfClass:[TTButtonTableField class]]) {
View
4 src/TTThumbView.m
@@ -46,11 +46,11 @@ - (void)layoutSubviews {
///////////////////////////////////////////////////////////////////////////////////////////////////
-- (NSString*)url {
+- (NSString*)thumbURL {
return imageView.url;
}
-- (void)setUrl:(NSString*)url {
+- (void)setThumbURL:(NSString*)url {
imageView.image = nil;
imageView.url = url;
}
View
14 src/TTThumbsTableViewCell.m
@@ -19,10 +19,10 @@ @implementation TTThumbsTableViewCell
- (void)assignPhotoAtIndex:(int)index toView:(TTThumbView*)thumbView {
id<TTPhoto> photo = [_photo.photoSource photoAtIndex:index];
if (photo) {
- thumbView.url = [photo urlForVersion:TTPhotoVersionThumbnail];
+ thumbView.thumbURL = [photo urlForVersion:TTPhotoVersionThumbnail];
thumbView.hidden = NO;
} else {
- thumbView.url = nil;
+ thumbView.thumbURL = nil;
thumbView.hidden = YES;
}
}
@@ -109,14 +109,14 @@ - (void)setPhoto:(id<TTPhoto>)photo {
_photo = [photo retain];
if (!_photo) {
- _thumbView1.url = nil;
- _thumbView2.url = nil;
- _thumbView3.url = nil;
- _thumbView4.url = nil;
+ _thumbView1.thumbURL = nil;
+ _thumbView2.thumbURL = nil;
+ _thumbView3.thumbURL = nil;
+ _thumbView4.thumbURL = nil;
return;
}
- _thumbView1.url = [_photo urlForVersion:TTPhotoVersionThumbnail];
+ _thumbView1.thumbURL = [_photo urlForVersion:TTPhotoVersionThumbnail];
[self assignPhotoAtIndex:_photo.index+1 toView:_thumbView2];
[self assignPhotoAtIndex:_photo.index+1 toView:_thumbView2];
[self assignPhotoAtIndex:_photo.index+2 toView:_thumbView3];
View
4 src/Three20/TTBackgroundView.h
@@ -8,7 +8,7 @@
UIColor* _fillColor;
UIColor* _fillColor2;
UIColor* _strokeColor;
- NSInteger _strokeRadius;
+ NSInteger _borderRadius;
UIEdgeInsets _backgroundInset;
}
@@ -16,7 +16,7 @@
@property(nonatomic,retain) UIColor* fillColor;
@property(nonatomic,retain) UIColor* fillColor2;
@property(nonatomic,retain) UIColor* strokeColor;
-@property(nonatomic) NSInteger strokeRadius;
+@property(nonatomic) NSInteger borderRadius;
@property(nonatomic) UIEdgeInsets backgroundInset;
@end
View
11 src/Three20/TTLinkView.h
@@ -4,13 +4,20 @@
@interface TTLinkView : UIControl {
id _delegate;
- id _href;
+ id _url;
TTBackgroundView* _screenView;
int _borderRadius;
}
@property(nonatomic,assign) id delegate;
-@property(nonatomic,retain) id href;
+
+/**
+ * The object that will be navigated to when the control is touched.
+ *
+ * This can be a string or an object that whose type is registered with TTNavigationCenter.
+ */
+@property(nonatomic,retain) id url;
+
@property(nonatomic) int borderRadius;
@end
View
14 src/Three20/TTTableField.h
@@ -2,14 +2,14 @@
@interface TTTableField : NSObject {
NSString* _text;
- NSString* _href;
+ NSString* _url;
}
@property(nonatomic,copy) NSString* text;
-@property(nonatomic,copy) NSString* href;
+@property(nonatomic,copy) NSString* url;
- (id)initWithText:(NSString*)text;
-- (id)initWithText:(NSString*)text href:(NSString*)href;
+- (id)initWithText:(NSString*)text url:(NSString*)url;
@end
@@ -47,7 +47,7 @@
@property(nonatomic,copy) NSString* title;
- (id)initWithTitle:(NSString*)title text:(NSString*)text;
-- (id)initWithTitle:(NSString*)title text:(NSString*)text href:(NSString*)href;
+- (id)initWithTitle:(NSString*)title text:(NSString*)text url:(NSString*)url;
@end
@@ -58,7 +58,7 @@
@property(nonatomic,copy) NSString* subtext;
- (id)initWithText:(NSString*)text subtext:(NSString*)subtext;
-- (id)initWithText:(NSString*)text subtext:(NSString*)subtext href:(NSString*)href;
+- (id)initWithText:(NSString*)text subtext:(NSString*)subtext url:(NSString*)url;
@end
@@ -70,9 +70,9 @@
@property(nonatomic,retain) UIImage* defaultImage;
@property(nonatomic,copy) NSString* image;
-- (id)initWithText:(NSString*)text href:(NSString*)href image:(NSString*)image;
+- (id)initWithText:(NSString*)text url:(NSString*)url image:(NSString*)image;
-- (id)initWithText:(NSString*)text href:(NSString*)href image:(NSString*)image
+- (id)initWithText:(NSString*)text url:(NSString*)url image:(NSString*)image
defaultImage:(UIImage*)image;
@end
View
2 src/Three20/TTThumbView.h
@@ -8,7 +8,7 @@
TTBackgroundView* borderView;
}
-@property(nonatomic,copy) NSString* url;
+@property(nonatomic,copy) NSString* thumbURL;
- (void)suspendLoading:(BOOL)suspended;

0 comments on commit d7bbd11

Please sign in to comment.
Something went wrong with that request. Please try again.