-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix compile for new files. added submodule for asi-http-request
- Loading branch information
Christopher White
committed
Aug 5, 2011
1 parent
91d048b
commit 1c98211
Showing
11 changed files
with
798 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,6 @@ | |
[submodule "gtm-http-fetcher"] | ||
path = gtm-http-fetcher | ||
url = [email protected]:chris124/gtm-http-fetcher.git | ||
[submodule "asi-http-request"] | ||
path = asi-http-request | ||
url = [email protected]:chris124/asi-http-request.git |
Submodule asi-http-request
added at
57f7ff
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// iOSSService.h | ||
// PhotoStream | ||
// | ||
// Created by Christopher White on 8/4/11. | ||
// Copyright 2011 Mad Races, Inc. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@protocol iOSSocialLocalUserProtocol; | ||
@protocol iOSSServiceProtocol <NSObject> | ||
|
||
@property(nonatomic, readonly, retain) NSString *name; | ||
@property(nonatomic, readonly, retain) NSURL *photoUrl; | ||
@property(nonatomic, readonly, retain) id<iOSSocialLocalUserProtocol> localUser; | ||
|
||
- (id)initWithDictionary:(NSDictionary*)serviceDictionary; | ||
|
||
@property(nonatomic, readonly, getter=isConnected) BOOL connected; // Authentication state | ||
|
||
@end | ||
|
||
@interface iOSSService : NSObject <iOSSServiceProtocol> | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// | ||
// iOSSService.m | ||
// PhotoStream | ||
// | ||
// Created by Christopher White on 8/4/11. | ||
// Copyright 2011 Mad Races, Inc. All rights reserved. | ||
// | ||
|
||
#import "iOSSService.h" | ||
#import "iOSSocialLocalUser.h" | ||
|
||
@interface iOSSService () | ||
|
||
@property(nonatomic, readwrite, retain) NSString *name; | ||
@property(nonatomic, readwrite, retain) NSURL *photoUrl; | ||
@property(nonatomic, readwrite, retain) id<iOSSocialLocalUserProtocol> localUser; | ||
|
||
@end | ||
|
||
@implementation iOSSService | ||
|
||
@synthesize name; | ||
@synthesize photoUrl; | ||
@synthesize localUser; | ||
|
||
- (id)init | ||
{ | ||
self = [super init]; | ||
if (self) { | ||
// Initialization code here. | ||
} | ||
|
||
return self; | ||
} | ||
|
||
- (id)initWithDictionary:(NSDictionary*)serviceDictionary | ||
{ | ||
self = [self init]; | ||
if (self) { | ||
// Initialization code here. | ||
self.name = [serviceDictionary objectForKey:@"name"]; | ||
self.photoUrl = [serviceDictionary objectForKey:@"photoUrl"]; | ||
self.localUser = [serviceDictionary objectForKey:@"localUser"]; | ||
} | ||
|
||
return self; | ||
} | ||
|
||
- (BOOL)isConnected | ||
{ | ||
//assert if instagram is nil. params have not been set! | ||
|
||
//if (NO == [self.instagram isSessionValid]) | ||
// return NO; | ||
return [self.localUser isAuthenticated]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// iOSSServiceTableViewCell.h | ||
// PhotoStream | ||
// | ||
// Created by Christopher White on 8/4/11. | ||
// Copyright 2011 Mad Races, Inc. All rights reserved. | ||
// | ||
|
||
#import "PRPSmartTableViewCell.h" | ||
|
||
@class iOSSService; | ||
@interface iOSSServiceTableViewCell : PRPSmartTableViewCell | ||
|
||
@property(nonatomic, retain) iOSSService *service; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// | ||
// iOSSServiceTableViewCell.m | ||
// PhotoStream | ||
// | ||
// Created by Christopher White on 8/4/11. | ||
// Copyright 2011 Mad Races, Inc. All rights reserved. | ||
// | ||
|
||
#import "iOSSServiceTableViewCell.h" | ||
#import "iOSSService.h" | ||
|
||
@interface iOSSServiceTableViewCell () { | ||
iOSSService *_service; | ||
} | ||
|
||
@end | ||
|
||
@implementation iOSSServiceTableViewCell | ||
|
||
@synthesize service=_service; | ||
|
||
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | ||
{ | ||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | ||
if (self) { | ||
// Initialization code | ||
} | ||
return self; | ||
} | ||
|
||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated | ||
{ | ||
[super setSelected:selected animated:animated]; | ||
|
||
// Configure the view for the selected state | ||
} | ||
|
||
+ (id)cellForTableView:(UITableView *)tableView { | ||
NSString *cellID = [self cellIdentifier]; | ||
UITableViewCell *cell = [tableView | ||
dequeueReusableCellWithIdentifier:cellID]; | ||
if (cell == nil) { | ||
cell = [[self alloc] initWithCellIdentifier:cellID]; | ||
} | ||
return cell; | ||
} | ||
|
||
|
||
- (id)initWithCellIdentifier:(NSString *)cellID { | ||
return [self initWithStyle:UITableViewCellStyleSubtitle | ||
reuseIdentifier:cellID]; | ||
} | ||
|
||
- (void)setService:(iOSSService*)theService | ||
{ | ||
_service = theService; | ||
|
||
self.textLabel.text = self.service.name; | ||
if ([self.service isConnected]) { | ||
self.detailTextLabel.text = @"connected"; | ||
} else { | ||
self.detailTextLabel.text = @"not connected"; | ||
} | ||
|
||
/* | ||
//first item is #name | ||
UILabel *textLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(5.0f, 5.0f, 50.0, 20.0)]; | ||
textLabel1.font = [UIFont boldSystemFontOfSize:14.0f]; | ||
textLabel1.text = [NSString stringWithFormat:@"#%@", self.photoSource.name]; | ||
[self.contentView addSubview:textLabel1]; | ||
//now a row of photos | ||
//need an array of urls from the mediaGroup | ||
UIImageView *imageView = nil; | ||
NSInteger index = 0; | ||
UIImage *image = nil; | ||
for (NSString *url in self.photoSource.previewImageURLs) { | ||
imageView = [[UIImageView alloc] initWithFrame:CGRectMake(5.0f+(100.0f*index), 30.0f, 100.0f, 100.0f)]; | ||
image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:url]]]; | ||
imageView.image = image; | ||
[self.contentView addSubview:imageView]; | ||
index++; | ||
} | ||
*/ | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// iOSServicesDataSource.h | ||
// PhotoStream | ||
// | ||
// Created by Christopher White on 8/4/11. | ||
// Copyright 2011 Mad Races, Inc. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "Three20/Three20.h" | ||
|
||
@protocol iOSSServiceProtocol; | ||
|
||
@protocol iOSServicesDataSourceProtocol <TTModel> | ||
|
||
/** | ||
* The title of this collection of tags. | ||
*/ | ||
@property (nonatomic, copy) NSString* title; | ||
|
||
/** | ||
* The total number of feed entries in the source, independent of the number that have been loaded. | ||
*/ | ||
@property (nonatomic, readonly) NSInteger numberOfObjects; | ||
|
||
/** | ||
* The maximum index of feed entries that have already been loaded. | ||
*/ | ||
@property (nonatomic, readonly) NSInteger maxObjectIndex; | ||
|
||
- (id<iOSSServiceProtocol>)objectAtIndex:(NSInteger)index; | ||
|
||
@end | ||
|
||
@interface iOSServicesDataSource : NSObject <TTTableViewDataSource, iOSServicesDataSourceProtocol> { | ||
id<TTModel> _model; | ||
} | ||
|
||
@property(nonatomic, readonly, assign) NSInteger count; | ||
|
||
@end |
Oops, something went wrong.