Skip to content

Commit

Permalink
text/call based on call column in parse. growth hacks - fb, invite, r…
Browse files Browse the repository at this point in the history
…ate app. bug fixes
  • Loading branch information
jtdaugh committed Apr 1, 2013
1 parent 379ecc1 commit c2d96ac
Show file tree
Hide file tree
Showing 7 changed files with 280 additions and 82 deletions.
5 changes: 4 additions & 1 deletion MarketLoco/CategoriesViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#import "CategoriesViewController.h"
#import "ViewController.h"

#define PEEK_AMOUNT 140.0f


@interface CategoriesViewController ()

@property (nonatomic, assign) CGFloat peekRightAmount;
Expand All @@ -34,7 +37,7 @@ - (void)viewDidLoad
[APP_DELEGATE setCategoriesViewController:self];
[self.categoriesTable setDataSource:self];
[self.categoriesTable setDelegate:self];
self.peekRightAmount = 40.0f;
self.peekRightAmount = PEEK_AMOUNT;
[self.slidingViewController setAnchorRightPeekAmount:self.peekRightAmount];
self.slidingViewController.underLeftWidthLayout = ECVariableRevealWidth;
}
Expand Down
3 changes: 2 additions & 1 deletion MarketLoco/FancyCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#import <Parse/Parse.h>
//#import "AppDelegate.h"

@interface FancyCell : UITableViewCell
@interface FancyCell : UITableViewCell

@property (nonatomic, strong) IBOutlet UILabel *title;
@property (nonatomic, strong) IBOutlet UILabel *description;
Expand All @@ -21,6 +21,7 @@
@property (nonatomic, strong) IBOutlet UIView *container;
@property (nonatomic, strong) IBOutlet UIButton *contactSeller;
@property (nonatomic, strong) PFObject *item;
@property (nonatomic, strong) NSNumber *callNotText;

-(IBAction)contactSellerClicked;
-(void)displaySMSComposerSheet;
Expand Down
28 changes: 16 additions & 12 deletions MarketLoco/FancyCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

@implementation FancyCell

@synthesize title, description, priceLabel, pic, container, contactSeller, item;

@synthesize title, description, priceLabel, pic, container, contactSeller, item, callNotText;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
Expand All @@ -35,18 +34,23 @@ -(IBAction)contactSellerClicked {
[item fetchIfNeeded];
[item incrementKey:@"mobileContact"];
[item saveInBackground];
Class messageClass = (NSClassFromString(@"MFMessageComposeViewController"));

if (messageClass != nil) {
[self displaySMSComposerSheet];
if (callNotText && callNotText == [NSNumber numberWithBool:YES]) {
NSString *phoneNumber = [@"telprompt://" stringByAppendingString:[item objectForKey:@"postedBy"]];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];
} else {
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle: @"Sorry!"
message: @"You cannot send this message from this device."
delegate: nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
Class messageClass = (NSClassFromString(@"MFMessageComposeViewController"));
if (messageClass != nil) {
[self displaySMSComposerSheet];
} else {
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle: @"Sorry!"
message: @"You cannot send this message from this device."
delegate: nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion MarketLoco/NetworksViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#import "NetworksViewController.h"
#import "ViewController.h"

#define PEEK_AMOUNT 50.0f

@interface NetworksViewController ()

@end
Expand All @@ -32,7 +34,7 @@ - (void)viewDidLoad
{
[super viewDidLoad];
[APP_DELEGATE setNetworkViewController:self];
[self.slidingViewController setAnchorLeftPeekAmount:40.0f];
[self.slidingViewController setAnchorLeftPeekAmount:PEEK_AMOUNT];
self.slidingViewController.underRightWidthLayout = ECFullWidth;

// Do any additional setup after loading the view.
Expand Down
18 changes: 16 additions & 2 deletions MarketLoco/ViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
#import "CategoriesViewController.h"

@interface ViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, CLLocationManagerDelegate, MFMailComposeViewControllerDelegate,
MFMessageComposeViewControllerDelegate> {
MFMessageComposeViewControllerDelegate, UIAlertViewDelegate> {
bool currentlyLoadingMore;
bool endResults;
NSInteger contactPressed;
}

@property (nonatomic, strong) CLLocationManager *locationManager;
Expand All @@ -35,7 +36,6 @@ MFMessageComposeViewControllerDelegate> {
@property (nonatomic, strong) IBOutlet UIBarButtonItem *networkButton;
@property (nonatomic, strong) IBOutlet UIBarButtonItem *categoryButton;
@property (nonatomic, strong) IBOutlet UINavigationItem *locoBar;
@property (nonatomic, strong) IBOutlet UIActivityIndicatorView *spinner;
@property (nonatomic, strong) NSString *networkName;
@property (nonatomic, strong) NSString *endResultsText;

Expand All @@ -45,6 +45,20 @@ MFMessageComposeViewControllerDelegate> {
-(void)getMoreObjectsWithQuery:(PFQuery *)query andStartIndex:(int) startIndex;
-(void)geoQueryForNetwork;
-(void)makeBarPretty;
-(void)initContactPressedCount;
-(void)getReferenceFancyCell;
-(void)initMixpanel;
-(void)setupSlidingControl;
-(void)setInitialNetwork;
-(void)growthHacksAfterClick;
-(void)askToLikeUsOnFB;
-(void)askToInviteFriends;
-(void)askToRateUs;
-(void)openFBPage;
-(void)inviteFriendsPopup;
-(void)doRateApp;


-(CGFloat)heightForFancyCellAtRow:(NSInteger)row;
-(CGFloat)heightForEndOfResultsRow;
-(UITableViewCell *)fancyCellAtRow:(NSInteger)row;
Expand Down
Loading

0 comments on commit c2d96ac

Please sign in to comment.