Skip to content

Commit

Permalink
stable finished version. Added logos and loading screen
Browse files Browse the repository at this point in the history
  • Loading branch information
jtdaugh committed Mar 21, 2013
1 parent 5b7a03b commit 7a4bab9
Show file tree
Hide file tree
Showing 21 changed files with 305 additions and 116 deletions.
Binary file added Default-568h@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Default@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions MarketLoco.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
objects = {

/* Begin PBXBuildFile section */
880869B816F980700089636B /* locologo.png in Resources */ = {isa = PBXBuildFile; fileRef = 880869B616F980700089636B /* locologo.png */; };
880869B916F980700089636B /* locologo@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 880869B716F980700089636B /* locologo@2x.png */; };
88298AC516FA741F00F514C3 /* contactSellerPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = 88298AC116FA741F00F514C3 /* contactSellerPressed.png */; };
88298AC616FA741F00F514C3 /* contactSellerPressed@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 88298AC216FA741F00F514C3 /* contactSellerPressed@2x.png */; };
88298AC716FA741F00F514C3 /* contactSeller@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 88298AC316FA741F00F514C3 /* contactSeller@2x.png */; };
88298AC816FA741F00F514C3 /* contactSeller.png in Resources */ = {isa = PBXBuildFile; fileRef = 88298AC416FA741F00F514C3 /* contactSeller.png */; };
88298ACB16FA8AA000F514C3 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 88298ACA16FA8AA000F514C3 /* Default.png */; };
88298ACD16FA8AA700F514C3 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 88298ACC16FA8AA700F514C3 /* Default@2x.png */; };
88298ACF16FA8AAC00F514C3 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 88298ACE16FA8AAC00F514C3 /* Default-568h@2x.png */; };
885E959816F81E60002AC914 /* FancyCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 885E959716F81E60002AC914 /* FancyCell.m */; };
885E959A16F81E73002AC914 /* FancyView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 885E959916F81E73002AC914 /* FancyView.xib */; };
88CE27B416F8EB540015D45F /* loading.gif in Resources */ = {isa = PBXBuildFile; fileRef = 88CE27B316F8EB540015D45F /* loading.gif */; };
Expand Down Expand Up @@ -43,6 +52,15 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
880869B616F980700089636B /* locologo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = locologo.png; sourceTree = "<group>"; };
880869B716F980700089636B /* locologo@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "locologo@2x.png"; sourceTree = "<group>"; };
88298AC116FA741F00F514C3 /* contactSellerPressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = contactSellerPressed.png; sourceTree = "<group>"; };
88298AC216FA741F00F514C3 /* contactSellerPressed@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "contactSellerPressed@2x.png"; sourceTree = "<group>"; };
88298AC316FA741F00F514C3 /* contactSeller@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "contactSeller@2x.png"; sourceTree = "<group>"; };
88298AC416FA741F00F514C3 /* contactSeller.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = contactSeller.png; sourceTree = "<group>"; };
88298ACA16FA8AA000F514C3 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
88298ACC16FA8AA700F514C3 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
88298ACE16FA8AAC00F514C3 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
885E959616F81E60002AC914 /* FancyCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FancyCell.h; sourceTree = "<group>"; };
885E959716F81E60002AC914 /* FancyCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FancyCell.m; sourceTree = "<group>"; };
885E959916F81E73002AC914 /* FancyView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FancyView.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -129,7 +147,16 @@
88E6278416F3E78100BDFA9F = {
isa = PBXGroup;
children = (
88298ACE16FA8AAC00F514C3 /* Default-568h@2x.png */,
88298ACC16FA8AA700F514C3 /* Default@2x.png */,
88298ACA16FA8AA000F514C3 /* Default.png */,
88CE27BE16F934140015D45F /* icon114.png */,
880869B616F980700089636B /* locologo.png */,
88298AC116FA741F00F514C3 /* contactSellerPressed.png */,
88298AC216FA741F00F514C3 /* contactSellerPressed@2x.png */,
88298AC316FA741F00F514C3 /* contactSeller@2x.png */,
88298AC416FA741F00F514C3 /* contactSeller.png */,
880869B716F980700089636B /* locologo@2x.png */,
88CE27BC16F9340B0015D45F /* icon57.png */,
88CE27B616F9106B0015D45F /* MessageUI.framework */,
88E6279916F3E78100BDFA9F /* MarketLoco */,
Expand Down Expand Up @@ -266,6 +293,15 @@
88CE27B416F8EB540015D45F /* loading.gif in Resources */,
88CE27BD16F9340C0015D45F /* icon57.png in Resources */,
88CE27BF16F934140015D45F /* icon114.png in Resources */,
880869B816F980700089636B /* locologo.png in Resources */,
880869B916F980700089636B /* locologo@2x.png in Resources */,
88298AC516FA741F00F514C3 /* contactSellerPressed.png in Resources */,
88298AC616FA741F00F514C3 /* contactSellerPressed@2x.png in Resources */,
88298AC716FA741F00F514C3 /* contactSeller@2x.png in Resources */,
88298AC816FA741F00F514C3 /* contactSeller.png in Resources */,
88298ACB16FA8AA000F514C3 /* Default.png in Resources */,
88298ACD16FA8AA700F514C3 /* Default@2x.png in Resources */,
88298ACF16FA8AAC00F514C3 /* Default-568h@2x.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
2 changes: 2 additions & 0 deletions MarketLoco/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#import <UIKit/UIKit.h>
#import <Parse/Parse.h>

#define APP_DELEGATE (AppDelegate *)[[UIApplication sharedApplication] delegate]

@class ViewController;

@interface AppDelegate : UIResponder <UIApplicationDelegate>
Expand Down
5 changes: 4 additions & 1 deletion MarketLoco/CategoriesViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@

#import <UIKit/UIKit.h>
#import "ECSlidingViewController.h"
#import <Parse/Parse.h>
#import "ParseData.h"
#import "AppDelegate.h"

@interface CategoriesViewController : UIViewController
@interface CategoriesViewController : UIViewController <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) IBOutlet UITableView *categoriesTable;

Expand Down
75 changes: 72 additions & 3 deletions MarketLoco/CategoriesViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "CategoriesViewController.h"
#import "ViewController.h"

@interface CategoriesViewController ()

Expand All @@ -16,6 +17,8 @@ @interface CategoriesViewController ()

@implementation CategoriesViewController

@synthesize categoriesTable;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
Expand All @@ -28,13 +31,79 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
- (void)viewDidLoad
{
[super viewDidLoad];
self.peekRightAmount = 40.0f;
[self.slidingViewController setAnchorLeftPeekAmount:self.peekRightAmount];
self.slidingViewController.underRightWidthLayout = ECVariableRevealWidth;
[self.categoriesTable setDataSource:self];
[self.categoriesTable setDelegate:self];
self.peekRightAmount = 40.0f;
[self.slidingViewController setAnchorRightPeekAmount:self.peekRightAmount];
self.slidingViewController.underLeftWidthLayout = ECVariableRevealWidth;

// Do any additional setup after loading the view.
}






- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// Return the number of sections.
return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [[[ParseData sharedParseData] categories] count]+1;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 50;
}

// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static NSString *CellIdentifier = @"categoryCell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];

}
NSString *title;
if (indexPath.row > 0) {
PFObject *object = [[[ParseData sharedParseData] categories] objectAtIndex:indexPath.row - 1];
title = [object objectForKey:@"name"];
} else {
title = @"All Items";
}
[cell.textLabel setText:title];
return cell;
}



- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *title;
if (indexPath.row == 0) {
title = @"All Items";
} else {
title = [[[[ParseData sharedParseData] categories] objectAtIndex:indexPath.row - 1] objectForKey:@"name"];
}
NSString *tempNetwork = [[APP_DELEGATE viewController] network];
if (!tempNetwork) tempNetwork = @"umich";
[[APP_DELEGATE viewController] pullNewestItemsForNetwork:tempNetwork andCategory:title];
[[[APP_DELEGATE viewController] tbView] scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:YES];

[self.slidingViewController resetTopView];

//do nothing
}







- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
Expand Down
21 changes: 4 additions & 17 deletions MarketLoco/FancyCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,29 +55,16 @@ -(void)displaySMSComposerSheet
if([MFMessageComposeViewController canSendText])
{
controller.body = @"I saw your item on MarketLoco. I'd like to buy it.";
controller.recipients = phoneNumber;
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
controller.messageComposeDelegate = appDelegate.viewController;
[appDelegate.viewController presentModalViewController:controller animated:YES];
controller.recipients = [NSArray arrayWithObject:phoneNumber];
controller.messageComposeDelegate = [APP_DELEGATE viewController];
[[APP_DELEGATE viewController] presentModalViewController:controller animated:YES];
}
//do nothing (OS will alert user of error)
}




- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result
{
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate.viewController presentModalViewController:controller animated:YES];
[appDelegate.viewController dismissModalViewControllerAnimated:YES];

if (result == MessageComposeResultCancelled)
NSLog(@"Message cancelled");
else if (result == MessageComposeResultSent)
NSLog(@"Message sent");
else
NSLog(@"Message failed");
}


@end
22 changes: 15 additions & 7 deletions MarketLoco/FancyView.xib
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<bytes key="NSWhite">MQA</bytes>
</object>
<int key="IBUIBaselineAdjustment">0</int>
<int key="IBUINumberOfLines">20</int>
<int key="IBUINumberOfLines">100</int>
<int key="IBUILineBreakMode">0</int>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<string key="name">HelveticaNeue-Light</string>
Expand All @@ -103,7 +103,6 @@
<string key="NSFrame">{{9, 200}, {262, 22}}</string>
<reference key="NSSuperview" ref="754895492"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
Expand Down Expand Up @@ -173,22 +172,26 @@
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="5590823"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwLjQgMC42AA</bytes>
</object>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<bool key="IBUIShowsTouchWhenHighlighted">YES</bool>
<string key="IBUINormalTitle">Contact Seller</string>
<reference key="IBUIHighlightedTitleColor" ref="899935308"/>
<reference key="IBUINormalTitleColor" ref="899935308"/>
<object class="NSColor" key="IBUINormalTitleShadowColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
<object class="NSCustomResource" key="IBUIHighlightedBackgroundImage" id="36163313">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">contactSellerPressed.png</string>
</object>
<reference key="IBUISelectedBackgroundImage" ref="36163313"/>
<object class="NSCustomResource" key="IBUINormalBackgroundImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">contactSeller.png</string>
</object>
<reference key="IBUIFontDescription" ref="560648139"/>
<reference key="IBUIFont" ref="766734403"/>
</object>
Expand Down Expand Up @@ -367,6 +370,7 @@
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="130.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="132.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="2" key="132.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
<string key="22.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="3.CustomClassName">FancyCell</string>
<string key="3.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
Expand Down Expand Up @@ -441,6 +445,10 @@
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<string key="contactSeller.png">{160, 40}</string>
<string key="contactSellerPressed.png">{160, 40}</string>
</dictionary>
<string key="IBCocoaTouchPluginVersion">1930</string>
</data>
</archive>
12 changes: 11 additions & 1 deletion MarketLoco/MarketLoco-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<string>Loco</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIcons</key>
Expand Down Expand Up @@ -41,6 +41,16 @@
<array>
<string>armv7</string>
</array>
<key>UIStatusBarTintParameters</key>
<dict>
<key>UINavigationBar</key>
<dict>
<key>Style</key>
<string>UIBarStyleBlack</string>
<key>Translucent</key>
<true/>
</dict>
</dict>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
Expand Down
1 change: 1 addition & 0 deletions MarketLoco/NetworksViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#import "ECSlidingViewController.h"
#import <Parse/Parse.h>
#import "ParseData.h"
#import "AppDelegate.h"

@interface NetworksViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>

Expand Down
19 changes: 13 additions & 6 deletions MarketLoco/NetworksViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "NetworksViewController.h"
#import "ViewController.h"

@interface NetworksViewController ()

Expand All @@ -29,10 +30,8 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
- (void)viewDidLoad
{
[super viewDidLoad];
[[self networkTable]setDataSource:self];
[[self networkTable]setDelegate:self];

[self.slidingViewController setAnchorLeftPeekAmount:-40.0f];

[self.slidingViewController setAnchorLeftPeekAmount:40.0f];
self.slidingViewController.underRightWidthLayout = ECFullWidth;

// Do any additional setup after loading the view.
Expand Down Expand Up @@ -67,15 +66,23 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

}
PFObject *object = [[[ParseData sharedParseData] networks] objectAtIndex:indexPath.row];
NSString *title = [object objectForKey:@"name"];
NSString *title = [object objectForKey:@"longName"];
[cell.textLabel setText:title];
return cell;
}



- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
//do nothing
PFObject *selected = [[[ParseData sharedParseData] networks] objectAtIndex:indexPath.row];
NSString *selectedNetwork = [selected objectForKey:@"namespace"];
[[NSUserDefaults standardUserDefaults] setObject:selectedNetwork forKey:@"network"];
[[NSUserDefaults standardUserDefaults] setObject:[selected objectForKey:@"name"] forKey:@"networkName"];
[[APP_DELEGATE viewController] pullNewestItemsForNetwork:selectedNetwork andCategory:@"All Items"];
[[[APP_DELEGATE viewController] tbView] scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:YES];

[self.slidingViewController resetTopView];

}


Expand Down
12 changes: 10 additions & 2 deletions MarketLoco/ViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
#import "NetworksViewController.h"
#import "CategoriesViewController.h"

@interface ViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, CLLocationManagerDelegate>
@interface ViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, CLLocationManagerDelegate, MFMailComposeViewControllerDelegate,
MFMessageComposeViewControllerDelegate>

@property (nonatomic, strong) CLLocationManager *locationManager;
@property (nonatomic,strong)CLLocation *userLocation;
Expand All @@ -26,11 +27,18 @@
@property (nonatomic, retain) NSMutableArray *itemPics;
@property (strong,nonatomic) NSMutableArray *filteredItemArray;
@property (nonatomic, strong) NSString *network;
@property (nonatomic, strong) NSString *category;
@property (nonatomic, strong) FancyCell *cellForReference;
@property (nonatomic, strong) IBOutlet UIBarButtonItem *networkButton;
@property (nonatomic, strong) IBOutlet UIBarButtonItem *categoryButton;
@property (nonatomic, strong) IBOutlet UINavigationItem *locoBar;
@property (nonatomic, strong) NSString *networkName;

-(void) pullNewestItems;
-(void)pullNewestItemsForNetwork:(NSString *) newNetwork andCategory:(NSString *) newCategory;
-(void)addItemsToBottomFromIndex:(int)startIndex;
-(void)getMoreObjectsWithQuery:(PFQuery *)query andStartIndex:(int) startIndex;
-(void)geoQueryForNetwork;
-(void) makeBarPretty;

- (IBAction)revealNetworks:(id)sender;
- (IBAction)revealCategories:(id)sender;
Expand Down
Loading

0 comments on commit 7a4bab9

Please sign in to comment.