Skip to content

Commit

Permalink
fix compile for new files. added submodule for asi-http-request
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher White committed Aug 5, 2011
1 parent 91d048b commit 1c98211
Show file tree
Hide file tree
Showing 11 changed files with 798 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions asi-http-request
Submodule asi-http-request added at 57f7ff
144 changes: 144 additions & 0 deletions iOSSocial/iOSSocial.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions iOSSocial/iOSSocial/iOSSService.h
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
58 changes: 58 additions & 0 deletions iOSSocial/iOSSocial/iOSSService.m
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
16 changes: 16 additions & 0 deletions iOSSocial/iOSSocial/iOSSServiceTableViewCell.h
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
87 changes: 87 additions & 0 deletions iOSSocial/iOSSocial/iOSSServiceTableViewCell.m
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
41 changes: 41 additions & 0 deletions iOSSocial/iOSSocial/iOSServicesDataSource.h
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
Loading

0 comments on commit 1c98211

Please sign in to comment.