├── icon.png ├── checkie.psd ├── icon@2x.png ├── Checkie ├── x.png ├── check.png ├── en.lproj │ └── InfoPlist.strings ├── logo.png ├── x@2x.png ├── check@2x.png ├── search.png ├── settings.png ├── search@2x.png ├── bubbleArrow.png ├── pullToRefresh.png ├── settings@2x.png ├── bubbleArrow@2x.png ├── pullToRefresh@2x.png ├── Chromeless │ ├── Images │ │ ├── back.png │ │ ├── back@2x.png │ │ ├── backWhite.png │ │ └── backWhite@2x.png │ ├── TJBackButton.h │ ├── TJScrollViewExtenderView.h │ ├── UIViewController+Loading.h │ ├── TJTinting.h │ ├── TJSwitch.h │ ├── TJScrollViewExtenderView.m │ ├── UITableView + PullToRefresh.h │ ├── TJPageControl.h │ ├── TJBackButton.m │ ├── UIViewController+Loading.m │ ├── TJPageControl.m │ ├── TJSwitch.m │ └── UITableView + PullToRefresh.m ├── FlurryAnalytics │ ├── libFlurryAnalytics.a │ └── FlurryAnalytics.h ├── CIAlertView.h ├── CIAlertView.m ├── CISettingsViewController.h ├── CILogInViewController.h ├── CIVenueCell.h ├── CICheckInCell.h ├── main.m ├── CITableViewController.h ├── Checkie-Prefix.pch ├── CIVenueViewController.h ├── CIAppDelegate.h ├── CIVenuesTableViewController.h ├── CIVenue.h ├── CIFoursquareEngine.h ├── CIVenueViewController.m ├── CISettingsViewController.m ├── Checkie-Info.plist ├── CITableViewController.m ├── CIVenueCell.m ├── CIAppDelegate.m ├── CIVenue.m ├── CICheckInCell.m ├── CILogInViewController.m ├── CIFoursquareEngine.m ├── CILogInViewController.xib ├── CIVenuesTableViewController.m └── CISettingsViewController.xib ├── .gitmodules ├── Readme.md └── Checkie.xcodeproj └── project.pbxproj /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpk/Checkie/master/icon.png -------------------------------------------------------------------------------- /checkie.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpk/Checkie/master/checkie.psd -------------------------------------------------------------------------------- /icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpk/Checkie/master/icon@2x.png -------------------------------------------------------------------------------- /Checkie/x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpk/Checkie/master/Checkie/x.png -------------------------------------------------------------------------------- /Checkie/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpk/Checkie/master/Checkie/check.png -------------------------------------------------------------------------------- /Checkie/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Checkie/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpk/Checkie/master/Checkie/logo.png -------------------------------------------------------------------------------- /Checkie/x@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpk/Checkie/master/Checkie/x@2x.png -------------------------------------------------------------------------------- /Checkie/check@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpk/Checkie/master/Checkie/check@2x.png -------------------------------------------------------------------------------- /Checkie/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpk/Checkie/master/Checkie/search.png -------------------------------------------------------------------------------- /Checkie/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpk/Checkie/master/Checkie/settings.png -------------------------------------------------------------------------------- /Checkie/search@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpk/Checkie/master/Checkie/search@2x.png -------------------------------------------------------------------------------- /Checkie/bubbleArrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpk/Checkie/master/Checkie/bubbleArrow.png -------------------------------------------------------------------------------- /Checkie/pullToRefresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpk/Checkie/master/Checkie/pullToRefresh.png -------------------------------------------------------------------------------- /Checkie/settings@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpk/Checkie/master/Checkie/settings@2x.png -------------------------------------------------------------------------------- /Checkie/bubbleArrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpk/Checkie/master/Checkie/bubbleArrow@2x.png -------------------------------------------------------------------------------- /Checkie/pullToRefresh@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpk/Checkie/master/Checkie/pullToRefresh@2x.png -------------------------------------------------------------------------------- /Checkie/Chromeless/Images/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpk/Checkie/master/Checkie/Chromeless/Images/back.png -------------------------------------------------------------------------------- /Checkie/Chromeless/Images/back@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpk/Checkie/master/Checkie/Chromeless/Images/back@2x.png -------------------------------------------------------------------------------- /Checkie/Chromeless/Images/backWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpk/Checkie/master/Checkie/Chromeless/Images/backWhite.png -------------------------------------------------------------------------------- /Checkie/Chromeless/Images/backWhite@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpk/Checkie/master/Checkie/Chromeless/Images/backWhite@2x.png -------------------------------------------------------------------------------- /Checkie/FlurryAnalytics/libFlurryAnalytics.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aaronpk/Checkie/master/Checkie/FlurryAnalytics/libFlurryAnalytics.a -------------------------------------------------------------------------------- /Checkie/CIAlertView.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface CIAlertView : UIAlertView 4 | 5 | @property (nonatomic, retain) id context; 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /Checkie/Chromeless/TJBackButton.h: -------------------------------------------------------------------------------- 1 | // TJBackButton 2 | // Chromeless 3 | // By Tim Johnsen 4 | 5 | #import "TJTinting.h" 6 | 7 | @interface TJBackButton : UIButton 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Vendor/JSONKit"] 2 | path = Vendor/JSONKit 3 | url = git://github.com/johnezang/JSONKit.git 4 | [submodule "Vendor/MessageUIAdditions"] 5 | path = Vendor/MessageUIAdditions 6 | url = git://github.com/tijoinc/MessageUIAdditions.git 7 | -------------------------------------------------------------------------------- /Checkie/CIAlertView.m: -------------------------------------------------------------------------------- 1 | #import "CIAlertView.h" 2 | 3 | @implementation CIAlertView 4 | 5 | @synthesize context; 6 | 7 | #pragma mark - 8 | #pragma mark NSObject 9 | 10 | - (void)dealloc { 11 | self.context = nil; 12 | 13 | [super dealloc]; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Checkie/CISettingsViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface CISettingsViewController : UIViewController { 4 | IBOutlet UIImageView *icon; 5 | } 6 | 7 | - (IBAction)back; 8 | - (IBAction)logOut; 9 | - (IBAction)feedback; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /Checkie/Chromeless/TJScrollViewExtenderView.h: -------------------------------------------------------------------------------- 1 | // TJScrollViewExtenderView 2 | // Chromeless 3 | // By Tim Johnsen 4 | 5 | #import 6 | 7 | @interface TJScrollViewExtenderView : UIView 8 | 9 | @property (nonatomic, retain) UIScrollView *scrollView; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /Checkie/CILogInViewController.h: -------------------------------------------------------------------------------- 1 | @interface CILogInViewController : UIViewController { 2 | IBOutlet UIWebView *webView; 3 | IBOutlet UIActivityIndicatorView *activityIndicator; 4 | } 5 | 6 | - (IBAction)goToSignInPage; 7 | 8 | - (void)succeed; 9 | - (void)fail; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /Checkie/CIVenueCell.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CIVenue.h" 3 | 4 | @interface CIVenueCell : UITableViewCell { 5 | CIVenue *_venue; 6 | 7 | UIImageView *_bubbleArrowView; 8 | } 9 | 10 | @property (nonatomic, retain) CIVenue *venue; 11 | 12 | + (CGFloat)heightWithVenue:(CIVenue *)venue; 13 | - (void)update; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Checkie/Chromeless/UIViewController+Loading.h: -------------------------------------------------------------------------------- 1 | // UIViewController+Loading 2 | // Chromeless 3 | // By Tim Johnsen 4 | 5 | #import 6 | #import "TJTinting.h" 7 | 8 | @interface UIViewController (Loading) 9 | 10 | - (void)startLoading:(BOOL)animated; 11 | - (void)startLoading:(BOOL)animated withTint:(TJTint)tint; 12 | - (void)stopLoadingAnimated:(BOOL)animated; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Checkie/CICheckInCell.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "CIFoursquareEngine.h" 4 | #import "CIVenue.h" 5 | 6 | @interface CICheckInCell : UITableViewCell { 7 | CIVenue *_venue; 8 | 9 | UIActivityIndicatorView *_activityIndicator; 10 | UIImageView *_check; 11 | 12 | UILabel *_pointsLabel; 13 | } 14 | 15 | @property (nonatomic, retain) CIVenue *venue; 16 | 17 | + (CGFloat)height; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Checkie/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Checkie 4 | // 5 | // Created by Tim Johnsen on 1/28/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CIAppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([CIAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Checkie/Chromeless/TJTinting.h: -------------------------------------------------------------------------------- 1 | // TJTinting 2 | // Chromeless 3 | // By Tim Johnsen 4 | 5 | typedef enum { 6 | TJTintBlack, 7 | TJTintWhite 8 | } TJTint; 9 | 10 | #import 11 | 12 | @protocol TJTinting 13 | 14 | - (TJTint)tint; 15 | - (void)setTint:(TJTint)tint; 16 | 17 | @optional 18 | 19 | - (id)initWithTint:(TJTint)tint; 20 | - (id)initWithFrame:(CGRect)frame tint:(TJTint)tint; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Checkie/CITableViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface CITableViewController : UIViewController { 4 | UITableView *_tableView; 5 | 6 | NSArray *_dataSource; 7 | } 8 | 9 | @property (nonatomic, retain) UITableView *tableView; 10 | 11 | - (id)objectForIndexPath:(NSIndexPath *)indexPath; 12 | - (UITableViewCell *)cellForObject:(id)object; 13 | - (CGFloat)heightForObject:(id)object; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Checkie/Checkie-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Checkie' target in the 'Checkie' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iOS SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Checkie/CIVenueViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CIVenueViewController.h 3 | // Checkie 4 | // 5 | // Created by Tim Johnsen on 3/2/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CIFoursquareEngine.h" 11 | 12 | @interface CIVenueViewController : UIViewController { 13 | UITextView *_textView; 14 | } 15 | 16 | @property (nonatomic, retain) CIVenue *venue; 17 | 18 | - (id)initWithVenue:(CIVenue *)aVenue; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Checkie/CIAppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CIVenuesTableViewController.h" 3 | 4 | @interface CIAppDelegate : UIResponder 5 | 6 | @property (nonatomic, retain) UIWindow *window; 7 | @property (nonatomic, retain) UINavigationController *navigationController; 8 | 9 | - (CIVenuesTableViewController *)venuesViewController; 10 | 11 | - (void)userDidLogOut:(NSNotification *)notification; 12 | - (void)userDidLogIn:(NSNotification *)notification; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Checkie/Chromeless/TJSwitch.h: -------------------------------------------------------------------------------- 1 | // TJSwitch 2 | // Chromeless 3 | // By Tim Johnsen 4 | 5 | #import 6 | #import "TJTinting.h" 7 | 8 | @interface TJSwitch : UIControl { 9 | UIScrollView *_scrollView; 10 | UIView *_nub; 11 | UIView *_inside; 12 | UILabel *_onLabel; 13 | BOOL _cachedState; 14 | } 15 | 16 | - (BOOL)isOn; 17 | - (void)setOn:(BOOL)on animated:(BOOL)animated; 18 | 19 | - (void)toggle; 20 | - (void)toggle:(BOOL)animated; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Checkie/CIVenuesTableViewController.h: -------------------------------------------------------------------------------- 1 | #import "CITableViewController.h" 2 | @class CIVenue; 3 | 4 | @interface CIVenuesTableViewController : CITableViewController { 5 | UITextField *_searchField; 6 | } 7 | 8 | @property (nonatomic, retain) NSMutableArray *cellObjects; 9 | 10 | - (void)refresh; 11 | - (void)refreshWithSearch:(BOOL)search; 12 | - (void)checkInAtVenue:(CIVenue *)venue; 13 | 14 | - (void)updateCellObjects; 15 | 16 | - (void)settings; 17 | 18 | - (void)login:(NSNotification *)notification; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Checkie/Chromeless/TJScrollViewExtenderView.m: -------------------------------------------------------------------------------- 1 | // TJScrollViewExtenderView 2 | // Chromeless 3 | // By Tim Johnsen 4 | 5 | #import "TJScrollViewExtenderView.h" 6 | 7 | @implementation TJScrollViewExtenderView 8 | 9 | @synthesize scrollView; 10 | 11 | #pragma mark - 12 | #pragma mark NSObject 13 | 14 | - (void)dealloc { 15 | self.scrollView = nil; 16 | [super dealloc]; 17 | } 18 | 19 | #pragma mark - 20 | #pragma mark UIView 21 | 22 | - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { 23 | if (self.scrollView) { 24 | return self.scrollView; 25 | } 26 | 27 | return [super hitTest:point withEvent:event]; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Checkie/Chromeless/UITableView + PullToRefresh.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView + PullToRefresh.h 3 | // Spartan 4 | // 5 | // Created by Tim Johnsen on 12/28/10. 6 | // Copyright 2010 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef enum{ 12 | TJPullToRefreshTintLight, 13 | TJPullToRefreshTintDark 14 | } TJPullToRefreshTint; 15 | 16 | 17 | @interface UITableView (PullToRefresh) 18 | 19 | -(void)setupPullToRefresh; 20 | -(void)setupPullToRefreshWithTint:(TJPullToRefreshTint)tint; 21 | -(void)removePullToRefresh; 22 | 23 | -(BOOL)hasPullToRefresh; 24 | 25 | -(BOOL)isLoading; 26 | 27 | -(void)startLoading; 28 | -(void)stopLoading; 29 | 30 | -(void)refresh; 31 | 32 | @end -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # Checkie 2 | *The quickest iOS foursquare Client in the old west* 3 | 4 | Checkie is a [foursquare](http://www.foursquare.com) client for the iOS from [tijo, inc](http://tijo.me). Built completely on the night of January 28th, 2012 from some sketches on a napkin, the code isn't quite super-high quality. 5 | 6 | The App aims to essentially combine foursquare with Amazon 1-Click, you tap on a venue and **BAM**, you're checked in. I kept finding that after visiting a place I always ended up stalling friends with conversation while checking in because foursquare takes several taps to check in. It even spawns a background task so you can close it the second you attempt to check in. 7 | 8 | **NOTE**: There are several #warnings in the App for foursquare OAuth and Flurry keys that I stripped from the App. In order for it to function as normal you'll need to provide these keys. -------------------------------------------------------------------------------- /Checkie/CIVenue.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface CIVenue : NSObject 4 | 5 | @property (nonatomic, retain) NSString *name; 6 | @property (nonatomic, retain) NSString *uniqueID; 7 | @property (nonatomic, retain) CLLocation *location; 8 | 9 | @property (nonatomic, retain) NSString *twitter; 10 | @property (nonatomic, retain) NSString *phone; 11 | @property (nonatomic, retain) NSString *category; 12 | @property (nonatomic, retain) NSString *city; 13 | @property (nonatomic, retain) NSString *url; 14 | @property (nonatomic, retain) NSString *menu; 15 | @property (nonatomic, retain) NSString *description; 16 | @property (nonatomic, retain) NSArray *photos; 17 | 18 | //@property (nonatomic, retain) NSArray *hereNow; 19 | 20 | + (CIVenue *)venueFromDictionary:(NSDictionary *)dictionary; 21 | - (void)updateFromDictionary:(NSDictionary *)dictionary; 22 | 23 | - (double)distance; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Checkie/CIFoursquareEngine.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CIVenue.h" 3 | 4 | @interface CIFoursquareEngine : NSObject 5 | 6 | @property (nonatomic, retain) CIVenue *checkingInVenue; 7 | @property (nonatomic, retain) CIVenue *checkedInVenue; 8 | @property (nonatomic, assign) int checkedInPoints; 9 | 10 | + (CIFoursquareEngine *)sharedEngine; 11 | + (NSString *)clientID; 12 | + (NSString *)clientSecret; 13 | + (NSString *)callbackURL; 14 | + (BOOL)isLoggedIn; 15 | + (NSString *)token; 16 | - (void)logout; 17 | 18 | - (CLLocationManager *)locationManager; 19 | 20 | - (void)getNearbyVenuesWithSearchString:(NSString *)string andCallback:(void (^)(NSArray *results))callback; 21 | - (void)checkInAtVenue:(CIVenue *)venue withCallback:(void (^)(BOOL result))callback; 22 | - (void)updateLastCheckedInVenueWithCallback:(void (^)(CIVenue *result))callback; 23 | - (BOOL)isCurrentlyCheckedInAtVenue:(CIVenue *)venue; 24 | - (BOOL)isCheckingInAtVenue:(CIVenue *)venue; 25 | 26 | - (void)getVenueWithID:(NSString *)uniqueID andCallback:(void (^)(CIVenue *venue))callback; 27 | 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Checkie/Chromeless/TJPageControl.h: -------------------------------------------------------------------------------- 1 | // TJPageControl 2 | // Chromeless 3 | // By Tim Johnsen 4 | 5 | typedef enum{ 6 | TJPageControlStyleEmptyIndicators, 7 | TJPageControlStyleShadedIndicators 8 | } TJPageControlStyle; 9 | 10 | typedef enum{ 11 | TJPageControlTypeCircle, 12 | TJPageControlTypeSquare 13 | } TJPageControlType; 14 | 15 | typedef enum{ 16 | TJPageControlAlignmentCenter, 17 | TJPageControlAlignmentLeftTop, 18 | TJPageControlAlignmentRightBottom 19 | } TJPageControlAlignment; 20 | 21 | 22 | @interface TJPageControl : UIView { 23 | int _numberOfPages; 24 | int _currentPage; 25 | id _delegate; 26 | 27 | CGFloat _indicatorSize; 28 | CGFloat _indicatorSpacing; 29 | UIColor *_baseColor; 30 | UIColor *_selectedColor; 31 | TJPageControlStyle _style; 32 | TJPageControlType _type; 33 | TJPageControlAlignment _alignment; 34 | } 35 | 36 | @property (nonatomic, assign) int numberOfPages; 37 | @property (nonatomic, assign) int currentPage; 38 | @property (nonatomic, assign) id delegate; 39 | 40 | @property (nonatomic, assign) CGFloat indicatorSize; 41 | @property (nonatomic, assign) CGFloat indicatorSpacing; 42 | @property (nonatomic, retain) UIColor *baseColor; 43 | @property (nonatomic, retain) UIColor *selectedColor; 44 | @property (nonatomic, assign) TJPageControlStyle style; 45 | @property (nonatomic, assign) TJPageControlType type; 46 | @property (nonatomic, assign) TJPageControlAlignment alignment; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Checkie/CIVenueViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CIVenueViewController.m 3 | // Checkie 4 | // 5 | // Created by Tim Johnsen on 3/2/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "CIVenueViewController.h" 10 | 11 | @implementation CIVenueViewController 12 | 13 | @synthesize venue; 14 | 15 | #pragma mark - 16 | #pragma mark NSObject 17 | 18 | - (void)dealloc { 19 | self.venue = nil; 20 | 21 | [super dealloc]; 22 | } 23 | 24 | #pragma mark - 25 | #pragma mark UIViewController 26 | 27 | - (void)loadView { 28 | [super loadView]; 29 | 30 | _textView = [[UITextView alloc] initWithFrame:[[self view] bounds]]; 31 | [[self view] addSubview:_textView]; 32 | [_textView release]; 33 | } 34 | 35 | - (void)viewDidUnload { 36 | [super viewDidUnload]; 37 | _textView = nil; 38 | } 39 | 40 | - (void)viewDidAppear:(BOOL)animated { 41 | [super viewDidAppear:animated]; 42 | [[self navigationController] setNavigationBarHidden:NO]; 43 | } 44 | 45 | - (void)viewWillDisappear:(BOOL)animated { 46 | [super viewWillDisappear:animated]; 47 | [[self navigationController] setNavigationBarHidden:YES]; 48 | } 49 | 50 | #pragma mark - 51 | #pragma mark Custom 52 | 53 | - (id)initWithVenue:(CIVenue *)aVenue { 54 | if ((self = [super init])) { 55 | self.venue = aVenue; 56 | 57 | [[CIFoursquareEngine sharedEngine] getVenueWithID:self.venue.uniqueID andCallback:^(CIVenue *loadedVenue){ 58 | dispatch_async(dispatch_get_main_queue(), ^{ 59 | self.venue = loadedVenue; 60 | }); 61 | }]; 62 | } 63 | 64 | return self; 65 | } 66 | 67 | @end -------------------------------------------------------------------------------- /Checkie/CISettingsViewController.m: -------------------------------------------------------------------------------- 1 | #import "CISettingsViewController.h" 2 | #import "CIFoursquareEngine.h" 3 | #import "MessageUI + TJAdditions.h" 4 | 5 | @implementation CISettingsViewController 6 | 7 | #pragma mark - 8 | #pragma mark NSObject 9 | 10 | - (id)init { 11 | if ((self = [super initWithNibName:@"CISettingsViewController" bundle:[NSBundle mainBundle]])) { 12 | } 13 | 14 | return self; 15 | } 16 | 17 | - (void)dealloc { 18 | [icon release]; 19 | 20 | [super dealloc]; 21 | } 22 | 23 | #pragma mark - 24 | #pragma mark UIViewController 25 | 26 | - (void)viewDidLoad { 27 | [super viewDidLoad]; 28 | 29 | icon.layer.cornerRadius = 12.0f; 30 | 31 | UISwipeGestureRecognizer *gr = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(back)]; 32 | [[self view] addGestureRecognizer:gr]; 33 | [gr release]; 34 | } 35 | 36 | - (void)viewDidUnload { 37 | [super viewDidUnload]; 38 | 39 | [icon release]; 40 | } 41 | 42 | #pragma mark - 43 | #pragma mark UIAlertViewDelegate 44 | 45 | - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex { 46 | if ([[alertView buttonTitleAtIndex:buttonIndex] isEqualToString:@"Log Out"]) { 47 | [[CIFoursquareEngine sharedEngine] logout]; 48 | } 49 | } 50 | 51 | #pragma mark - 52 | #pragma mark Actions 53 | 54 | - (IBAction)back { 55 | [[self navigationController] popViewControllerAnimated:YES]; 56 | } 57 | 58 | - (IBAction)logOut { 59 | [[[[UIAlertView alloc] initWithTitle:@"Log Out?" message:@"Are you sure you want to log out?" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Log Out", nil] autorelease] show]; 60 | } 61 | 62 | - (IBAction)feedback { 63 | [MFMailComposeViewController presentFeedbackEmailViewControllerInViewController:self]; 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /Checkie/Checkie-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | icon.png 14 | icon@2x.png 15 | 16 | CFBundleIcons 17 | 18 | CFBundlePrimaryIcon 19 | 20 | CFBundleIconFiles 21 | 22 | icon.png 23 | icon@2x.png 24 | 25 | UIPrerenderedIcon 26 | 27 | 28 | 29 | CFBundleIdentifier 30 | com.tijo.checkIn 31 | CFBundleInfoDictionaryVersion 32 | 6.0 33 | CFBundleName 34 | ${PRODUCT_NAME} 35 | CFBundlePackageType 36 | APPL 37 | CFBundleShortVersionString 38 | 2.0.1 39 | CFBundleSignature 40 | ???? 41 | CFBundleVersion 42 | 2.0.1 43 | LSRequiresIPhoneOS 44 | 45 | UIPrerenderedIcon 46 | 47 | UIStatusBarStyle 48 | UIStatusBarStyleBlackOpaque 49 | UISupportedInterfaceOrientations 50 | 51 | UIInterfaceOrientationPortrait 52 | UIInterfaceOrientationLandscapeLeft 53 | UIInterfaceOrientationLandscapeRight 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /Checkie/CITableViewController.m: -------------------------------------------------------------------------------- 1 | #import "CITableViewController.h" 2 | 3 | @implementation CITableViewController 4 | 5 | @synthesize tableView = _tableView; 6 | 7 | #pragma mark - 8 | #pragma mark NSObject 9 | 10 | - (void)dealloc { 11 | [_tableView setDelegate:nil]; 12 | [_tableView setDataSource:nil]; 13 | [_tableView release]; 14 | 15 | [super dealloc]; 16 | } 17 | 18 | #pragma mark - 19 | #pragma mark UIViewController 20 | 21 | - (void)loadView { 22 | [super loadView]; 23 | 24 | self.tableView = [[[UITableView alloc] initWithFrame:[[self view] bounds] style:UITableViewStylePlain] autorelease]; 25 | self.tableView.delegate = self; 26 | self.tableView.dataSource = self; 27 | self.tableView.separatorColor = [UIColor blackColor]; 28 | [[self view] addSubview:[self tableView]]; 29 | } 30 | 31 | #pragma mark - 32 | #pragma mark UITableViewDataSource 33 | 34 | - (int)numberOfSectionsInTableView:(UITableView *)tableView { 35 | return 0; 36 | } 37 | 38 | - (int)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 39 | return 0; 40 | } 41 | 42 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 43 | return [self cellForObject:[self objectForIndexPath:indexPath]]; 44 | } 45 | 46 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 47 | return [self heightForObject:[self objectForIndexPath:indexPath]]; 48 | } 49 | 50 | #pragma mark - 51 | #pragma mark UITableViewDelegate 52 | 53 | #pragma mark - 54 | #pragma mark CITableViewController 55 | 56 | - (id)objectForIndexPath:(NSIndexPath *)indexPath { 57 | return nil; 58 | } 59 | 60 | - (CGFloat)heightForObject:(id)object { 61 | return 44.0f; 62 | } 63 | 64 | - (UITableViewCell *)cellForObject:(id)object { 65 | return nil; 66 | } 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /Checkie/CIVenueCell.m: -------------------------------------------------------------------------------- 1 | #import "CIVenueCell.h" 2 | #import "CIFoursquareEngine.h" 3 | 4 | @implementation CIVenueCell 5 | 6 | @synthesize venue = _venue; 7 | 8 | #pragma mark - 9 | #pragma mark NSObject 10 | 11 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { 12 | if ((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) { 13 | [[self textLabel] setNumberOfLines:0]; 14 | [[self textLabel] setLineBreakMode:UILineBreakModeWordWrap]; 15 | [[self textLabel] setFont:[UIFont boldSystemFontOfSize:18.0f]]; 16 | 17 | UIView *backgroundView = [[UIView alloc] init]; 18 | [backgroundView setBackgroundColor:[UIColor blackColor]]; 19 | [self setSelectedBackgroundView:backgroundView]; 20 | [backgroundView release]; 21 | 22 | _bubbleArrowView = [[UIImageView alloc] initWithFrame:CGRectMake(20.0f, self.bounds.size.height - 10.0f, 20.0f, 10.0f)]; 23 | [_bubbleArrowView setImage:[UIImage imageNamed:@"bubbleArrow"]]; 24 | [_bubbleArrowView setAutoresizingMask:UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin]; 25 | [self addSubview:_bubbleArrowView]; 26 | [_bubbleArrowView setHidden:YES]; 27 | } 28 | 29 | return self; 30 | } 31 | 32 | - (void)dealloc { 33 | [_venue release]; 34 | 35 | [super dealloc]; 36 | } 37 | 38 | #pragma mark - 39 | #pragma mark CIVenueCell 40 | 41 | - (void)setVenue:(CIVenue *)venue { 42 | [_venue autorelease]; 43 | _venue = [venue retain]; 44 | 45 | [self update]; 46 | } 47 | 48 | - (void)update { 49 | [[self textLabel] setText:self.venue.name]; 50 | 51 | if ([[CIFoursquareEngine sharedEngine] isCheckingInAtVenue:self.venue] || [[CIFoursquareEngine sharedEngine] isCurrentlyCheckedInAtVenue:self.venue]) { 52 | _bubbleArrowView.hidden = NO; 53 | } else { 54 | _bubbleArrowView.hidden = YES; 55 | } 56 | } 57 | 58 | #pragma mark - 59 | #pragma mark Sizing 60 | 61 | + (CGFloat)heightWithVenue:(CIVenue *)venue { 62 | CGFloat height = [venue.name sizeWithFont:[UIFont boldSystemFontOfSize:18.0f] constrainedToSize:CGSizeMake(300.0f, CGFLOAT_MAX) lineBreakMode:UILineBreakModeWordWrap].height + 20; 63 | 64 | if (height < 44.0f) { 65 | return 44.0f; 66 | } 67 | 68 | return height; 69 | } 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /Checkie/Chromeless/TJBackButton.m: -------------------------------------------------------------------------------- 1 | // TJBackButton 2 | // Chromeless 3 | // By Tim Johnsen 4 | 5 | #import "TJBackButton.h" 6 | 7 | @implementation TJBackButton 8 | 9 | #pragma mark - 10 | #pragma mark NSObject 11 | 12 | - (id)init { 13 | if ((self = [super init])) { 14 | [self setTint:TJTintBlack]; 15 | } 16 | 17 | return self; 18 | } 19 | 20 | #pragma mark - 21 | #pragma mark UIView 22 | 23 | // TODO: Override other init methods 24 | 25 | - (id)initWithFrame:(CGRect)frame { 26 | CGSize size = [[UIImage imageNamed:@"back"] size]; 27 | if ((self = [super initWithFrame:CGRectMake(frame.origin.x, frame.origin.y, size.width, size.height)])) { 28 | [self setTint:TJTintBlack]; 29 | } 30 | 31 | return self; 32 | } 33 | 34 | - (void)setFrame:(CGRect)frame { 35 | CGSize size = [[UIImage imageNamed:@"back"] size]; 36 | [super setFrame:CGRectMake(frame.origin.x, frame.origin.y, size.width, size.height)]; 37 | } 38 | 39 | - (void)setBounds:(CGRect)bounds { 40 | CGSize size = [[UIImage imageNamed:@"back"] size]; 41 | [super setBounds:CGRectMake(0.0f, 0.0f, size.width, size.height)]; 42 | } 43 | 44 | #pragma mark - 45 | #pragma mark TJTinting 46 | 47 | - (id)initWithTint:(TJTint)tint { 48 | if ((self = [super init])) { 49 | [self setTint:tint]; 50 | } 51 | 52 | return self; 53 | } 54 | 55 | - (id)initWithFrame:(CGRect)frame tint:(TJTint)tint { 56 | if ((self = [super initWithFrame:frame])) { 57 | [self setTint:tint]; 58 | } 59 | 60 | return self; 61 | } 62 | 63 | - (void)setTint:(TJTint)tint { 64 | [self setTitle:@" Back" forState:UIControlStateNormal]; 65 | [[self titleLabel] setFont:[UIFont boldSystemFontOfSize:15.0f]]; 66 | [self setTitleColor:[UIColor grayColor] forState:UIControlStateHighlighted]; 67 | [self setTitleColor:[UIColor grayColor] forState:UIControlStateSelected]; 68 | [self setAdjustsImageWhenHighlighted:YES]; 69 | 70 | if (tint == TJTintWhite) { 71 | [self setBackgroundImage:[UIImage imageNamed:@"backWhite"] forState:UIControlStateNormal]; 72 | 73 | [self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 74 | } else { 75 | [self setBackgroundImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal]; 76 | [self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 77 | } 78 | } 79 | 80 | - (TJTint)tint { 81 | return ([self titleColorForState:UIControlStateNormal] == [UIColor whiteColor]) ? TJTintBlack : TJTintWhite; 82 | } 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /Checkie/CIAppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "CIAppDelegate.h" 2 | #import "CIFoursquareEngine.h" 3 | #import "CILogInViewController.h" 4 | #import "FlurryAnalytics.h" 5 | 6 | void uncaughtExceptionHandler(NSException *exception); 7 | void uncaughtExceptionHandler(NSException *exception) { 8 | [FlurryAnalytics logError:@"Uncaught" message:@"Crash!" exception:exception]; 9 | } 10 | 11 | @implementation CIAppDelegate 12 | 13 | @synthesize window = _window; 14 | @synthesize navigationController; 15 | 16 | - (void)dealloc { 17 | [_window release]; 18 | [super dealloc]; 19 | } 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 22 | self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; 23 | self.window.backgroundColor = [UIColor whiteColor]; 24 | [self.window makeKeyAndVisible]; 25 | 26 | self.navigationController = [[[UINavigationController alloc] init] autorelease]; 27 | [self.navigationController setNavigationBarHidden:YES]; 28 | 29 | if ([CIFoursquareEngine isLoggedIn]) { 30 | [self.navigationController pushViewController:[self venuesViewController] animated:YES]; 31 | } else { 32 | [self.navigationController pushViewController:[[[CILogInViewController alloc] init] autorelease] animated:YES]; 33 | } 34 | 35 | [self.window addSubview:self.navigationController.view]; 36 | 37 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(userDidLogIn:) name:@"login" object:nil]; 38 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(userDidLogOut:) name:@"logout" object:nil]; 39 | 40 | #if !DEBUG 41 | #warning Flurry Key is omitted from the open source version of Checkie 42 | [FlurryAnalytics startSession:@"[ REDACTED ]"]; 43 | NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler); 44 | #endif 45 | 46 | return YES; 47 | } 48 | 49 | - (void)applicationDidBecomeActive:(UIApplication *)application { 50 | [[self venuesViewController] refresh]; 51 | } 52 | 53 | - (CIVenuesTableViewController *)venuesViewController { 54 | static CIVenuesTableViewController *venues = nil; 55 | static dispatch_once_t onceToken; 56 | dispatch_once(&onceToken, ^{ 57 | venues = [[CIVenuesTableViewController alloc] init]; 58 | }); 59 | 60 | return venues; 61 | } 62 | 63 | - (void)userDidLogOut:(NSNotification *)notification { 64 | [self.navigationController setViewControllers:[NSArray arrayWithObject:[[[CILogInViewController alloc] init] autorelease]] animated:YES]; 65 | } 66 | 67 | - (void)userDidLogIn:(NSNotification *)notification { 68 | [self.navigationController setViewControllers:[NSArray arrayWithObject:[self venuesViewController]] animated:YES]; 69 | } 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /Checkie/CIVenue.m: -------------------------------------------------------------------------------- 1 | #import "CIVenue.h" 2 | #import "CIFoursquareEngine.h" 3 | 4 | @implementation CIVenue 5 | 6 | @synthesize name; 7 | @synthesize uniqueID; 8 | @synthesize location; 9 | 10 | @synthesize twitter; 11 | @synthesize phone; 12 | @synthesize category; 13 | @synthesize city; 14 | @synthesize url; 15 | @synthesize menu; 16 | @synthesize description; 17 | @synthesize photos; 18 | 19 | #pragma mark - 20 | #pragma mark NSObject 21 | 22 | + (CIVenue *)venueFromDictionary:(NSDictionary *)dictionary { 23 | CIVenue *venue = [[CIVenue alloc] init]; 24 | 25 | [venue updateFromDictionary:dictionary]; 26 | 27 | return [venue autorelease]; 28 | } 29 | 30 | - (void)updateFromDictionary:(NSDictionary *)dictionary { 31 | [self setUniqueID:[dictionary valueForKey:@"id"]]; 32 | [self setName:[dictionary valueForKey:@"name"]]; 33 | double latitude = [[[dictionary valueForKey:@"location"] valueForKey:@"lat"] doubleValue]; 34 | double longitude = [[[dictionary valueForKey:@"location"] valueForKey:@"lng"] doubleValue]; 35 | [self setLocation:[[[CLLocation alloc] initWithLatitude:latitude longitude:longitude] autorelease]]; 36 | 37 | [self setTwitter:[[dictionary valueForKey:@"contact"] valueForKey:@"twitter"]]; 38 | NSString *aPhone = [[dictionary valueForKey:@"contact"] valueForKey:@"formattedPhone"]; 39 | if (!aPhone) { 40 | aPhone = [[dictionary valueForKey:@"contact"] valueForKey:@"phone"]; 41 | } 42 | [self setPhone:aPhone]; 43 | for (NSDictionary *aCategory in [dictionary valueForKey:@"categories"]) { 44 | if ([[aCategory valueForKey:@"primary"] boolValue]) { 45 | [self setCategory:[aCategory valueForKey:@"name"]]; 46 | break; 47 | } 48 | } 49 | [self setCity:[[dictionary valueForKey:@"location"] valueForKey:@"city"]]; 50 | [self setUrl:[dictionary valueForKey:@"url"]]; 51 | [self setMenu:[dictionary valueForKey:@"menu"]]; 52 | [self setDescription:[dictionary valueForKey:@"description"]]; 53 | 54 | NSMutableArray *allPhotos = [[NSMutableArray alloc] init]; 55 | for (NSDictionary *group in [[dictionary valueForKey:@"photos"] valueForKey:@"groups"]) { 56 | for (NSDictionary *photo in [group valueForKey:@"items"]) { 57 | [allPhotos addObject:[photo valueForKey:@"url"]]; 58 | } 59 | } 60 | [self setPhotos:allPhotos]; 61 | [allPhotos release]; 62 | } 63 | 64 | - (void)dealloc { 65 | self.name = nil; 66 | self.uniqueID = nil; 67 | 68 | [super dealloc]; 69 | } 70 | 71 | - (BOOL)isEqual:(id)object { 72 | if ([object isKindOfClass:[CIVenue class]] && [[(CIVenue *)object uniqueID] isEqual:self.uniqueID]) { 73 | return YES; 74 | } 75 | return NO; 76 | } 77 | 78 | - (double)distance { 79 | CLLocation *currentLocation = [[[CIFoursquareEngine sharedEngine] locationManager] location]; 80 | 81 | return [currentLocation distanceFromLocation:self.location]; 82 | } 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /Checkie/CICheckInCell.m: -------------------------------------------------------------------------------- 1 | #import "CICheckInCell.h" 2 | 3 | @implementation CICheckInCell 4 | 5 | @synthesize venue = _venue; 6 | 7 | #pragma mark - 8 | #pragma mark NSObject 9 | 10 | - (void)dealloc { 11 | [_activityIndicator release]; 12 | [_check release]; 13 | [_venue release]; 14 | [_pointsLabel release]; 15 | 16 | [super dealloc]; 17 | } 18 | 19 | #pragma mark - 20 | #pragma mark UITableViewCell 21 | 22 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { 23 | if ((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) { 24 | [[self contentView] setBackgroundColor:[UIColor blackColor]]; 25 | [[self textLabel] setBackgroundColor:[UIColor blackColor]]; 26 | [[self textLabel] setTextColor:[UIColor whiteColor]]; 27 | [self setIndentationLevel:1]; 28 | [self setIndentationWidth:38.0f]; 29 | [self setSelectionStyle:UITableViewCellSelectionStyleNone]; 30 | 31 | _activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; 32 | [_activityIndicator setFrame:CGRectMake(0.0f, 0.0f, [CICheckInCell height], [CICheckInCell height])]; 33 | [_activityIndicator setAutoresizingMask:UIViewAutoresizingFlexibleRightMargin]; 34 | [_activityIndicator startAnimating]; 35 | [_activityIndicator setHidesWhenStopped:NO]; 36 | [self addSubview:_activityIndicator]; 37 | 38 | _check = [[UIImageView alloc] init]; 39 | [_check setFrame:CGRectMake(0.0f, 0.0f, [CICheckInCell height], [CICheckInCell height])]; 40 | [_check setAutoresizingMask:UIViewAutoresizingFlexibleRightMargin]; 41 | [self addSubview:_check]; 42 | 43 | _pointsLabel = [[UILabel alloc] init]; 44 | [_pointsLabel setBackgroundColor:[UIColor clearColor]]; 45 | [_pointsLabel setTextColor:[UIColor colorWithWhite:0.8 alpha:1.0]]; 46 | [_pointsLabel setTextAlignment:UITextAlignmentRight]; 47 | [_pointsLabel setBounds:CGRectMake(0.0, 0.0, 64.0, 44.0)]; 48 | [_pointsLabel setFont:[UIFont systemFontOfSize:18.0]]; 49 | [_pointsLabel setCenter:CGPointMake(self.bounds.size.width - 12.0 - _pointsLabel.bounds.size.width / 2.0, self.bounds.size.height / 2.0)]; 50 | [self addSubview:_pointsLabel]; 51 | } 52 | 53 | return self; 54 | } 55 | 56 | #pragma mark - 57 | #pragma mark Getters and Setters 58 | 59 | - (void)setVenue:(CIVenue *)venue { 60 | [_venue autorelease]; 61 | _venue = [venue retain]; 62 | 63 | if ([[CIFoursquareEngine sharedEngine] isCurrentlyCheckedInAtVenue:self.venue]) { 64 | _activityIndicator.hidden = YES; 65 | _check.hidden = NO; 66 | _check.image = [UIImage imageNamed:@"check"]; 67 | [[self textLabel] setText:@"Checked In!"]; 68 | int points = [[CIFoursquareEngine sharedEngine] checkedInPoints]; 69 | if (points) { 70 | [_pointsLabel setText:[NSString stringWithFormat:@"+%d", points]]; 71 | } else { 72 | [_pointsLabel setText:nil]; 73 | } 74 | } else if ([[CIFoursquareEngine sharedEngine] isCheckingInAtVenue:self.venue]) { 75 | _activityIndicator.hidden = NO; 76 | _check.hidden = YES; 77 | [[self textLabel] setText:@"Checking In..."]; 78 | [_pointsLabel setText:nil]; 79 | } else { 80 | _activityIndicator.hidden = YES; 81 | _check.hidden = NO; 82 | _check.image = [UIImage imageNamed:@"x"]; 83 | [[self textLabel] setText:@"Failed to Check In"]; 84 | [_pointsLabel setText:nil]; 85 | } 86 | } 87 | 88 | #pragma mark - 89 | #pragma mark Sizing 90 | 91 | + (CGFloat)height { 92 | return 44.0f; 93 | } 94 | 95 | @end 96 | -------------------------------------------------------------------------------- /Checkie/FlurryAnalytics/FlurryAnalytics.h: -------------------------------------------------------------------------------- 1 | // 2 | // FlurryAnalytics.h 3 | // Flurry iOS Analytics Agent 4 | // 5 | // Copyright 2009-2011 Flurry, Inc. All rights reserved. 6 | // 7 | // Methods in this header file are for use with Flurry Analytics 8 | 9 | #import 10 | 11 | /*! 12 | * \brief Provides all available methods for defining and reporting Analytics from use 13 | * of your app. 14 | * 15 | * Set of methods that allow developers to capture detailed, aggregate information 16 | * regarding the use of their app by end users. 17 | * \author 2009 - 2011 Flurry, Inc. All Rights Reserved. 18 | */ 19 | 20 | /*! 21 | * @class FlurryAnalytics 22 | * @abstract Provides all available methods for defining and reporting Analytics from use 23 | * of your app. 24 | * @discussion Set of methods that allow developers to capture detailed, aggregate information 25 | * regarding the use of their app by end users. 26 | * @helps This class provides methods necessary for correct function of FlurryAppCircle.h. 27 | * For information on how to use Flurry's AppCircle SDK to 28 | * attract high-quality users and monetize your user base see http://wiki.flurry.com/index.php?title=AppCircle. 29 | * 30 | */ 31 | 32 | @interface FlurryAnalytics : NSObject { 33 | } 34 | 35 | /* 36 | optional sdk settings that should be called before start session 37 | */ 38 | + (void)setAppVersion:(NSString *)version; // override the app version 39 | + (NSString *)getFlurryAgentVersion; // get the Flurry Agent version number 40 | + (void)setShowErrorInLogEnabled:(BOOL)value; // default is NO 41 | + (void)setDebugLogEnabled:(BOOL)value; // generate debug logs for Flurry support, default is NO 42 | + (void)setSessionContinueSeconds:(int)seconds; // default is 10 seconds 43 | + (void)setSecureTransportEnabled:(BOOL)value; // set data to be sent over SSL, default is NO 44 | 45 | /* 46 | start session, attempt to send saved sessions to server 47 | */ 48 | + (void)startSession:(NSString *)apiKey; 49 | 50 | /* 51 | log events or errors after session has started 52 | */ 53 | + (void)logEvent:(NSString *)eventName; 54 | + (void)logEvent:(NSString *)eventName withParameters:(NSDictionary *)parameters; 55 | + (void)logError:(NSString *)errorID message:(NSString *)message exception:(NSException *)exception; 56 | + (void)logError:(NSString *)errorID message:(NSString *)message error:(NSError *)error; 57 | 58 | /* 59 | start or end timed events 60 | */ 61 | + (void)logEvent:(NSString *)eventName timed:(BOOL)timed; 62 | + (void)logEvent:(NSString *)eventName withParameters:(NSDictionary *)parameters timed:(BOOL)timed; 63 | + (void)endTimedEvent:(NSString *)eventName withParameters:(NSDictionary *)parameters; // non-nil parameters will update the parameters 64 | 65 | /* 66 | count page views 67 | */ 68 | + (void)logAllPageViews:(id)target; // automatically track page view on UINavigationController or UITabBarController 69 | + (void)logPageView; // manually increment page view by 1 70 | 71 | /* 72 | set user info 73 | */ 74 | + (void)setUserID:(NSString *)userID; // user's id in your system 75 | + (void)setAge:(int)age; // user's age in years 76 | + (void)setGender:(NSString *)gender; // user's gender m or f 77 | 78 | /* 79 | set location information 80 | */ 81 | + (void)setLatitude:(double)latitude longitude:(double)longitude horizontalAccuracy:(float)horizontalAccuracy verticalAccuracy:(float)verticalAccuracy; 82 | 83 | /* 84 | optional session settings that can be changed after start session 85 | */ 86 | + (void)setSessionReportsOnCloseEnabled:(BOOL)sendSessionReportsOnClose; // default is YES 87 | + (void)setSessionReportsOnPauseEnabled:(BOOL)setSessionReportsOnPauseEnabled; // default is NO 88 | + (void)setEventLoggingEnabled:(BOOL)value; // default is YES 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /Checkie/CILogInViewController.m: -------------------------------------------------------------------------------- 1 | #import "CILogInViewController.h" 2 | #import "UIViewController+Loading.h" 3 | #import "CIFoursquareEngine.h" 4 | #import "JSONKit.h" 5 | 6 | @implementation CILogInViewController 7 | 8 | - (id)init { 9 | if (self = [super initWithNibName:@"CILogInViewController" bundle:[NSBundle mainBundle]]) { 10 | } 11 | 12 | return self; 13 | } 14 | 15 | - (void)viewDidUnload { 16 | [webView stopLoading]; 17 | [webView setDelegate:nil]; 18 | webView = nil; 19 | activityIndicator = nil; 20 | [super viewDidUnload]; 21 | } 22 | 23 | - (void)dealloc { 24 | [webView release]; 25 | [activityIndicator release]; 26 | [super dealloc]; 27 | } 28 | 29 | #pragma mark - View lifecycle 30 | 31 | - (void)viewDidLoad { 32 | [super viewDidLoad]; 33 | 34 | [self goToSignInPage]; 35 | } 36 | 37 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 38 | return interfaceOrientation == UIInterfaceOrientationPortrait; 39 | } 40 | 41 | - (IBAction)goToSignInPage { 42 | [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://foursquare.com/oauth2/authenticate?client_id=%@&response_type=code&redirect_uri=%@", [CIFoursquareEngine clientID], @"http://www.google.com"]]]]; 43 | } 44 | 45 | #pragma mark - 46 | #pragma mark UIWebViewDelegate 47 | 48 | - (void)webViewDidStartLoad:(UIWebView *)webView { 49 | [activityIndicator startAnimating]; 50 | } 51 | 52 | - (void)webViewDidFinishLoad:(UIWebView *)webView { 53 | [activityIndicator stopAnimating]; 54 | } 55 | 56 | #pragma mark - 57 | #pragma mark UIWebViewDelegate 58 | 59 | - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { 60 | NSString *url =[[request URL] absoluteString]; 61 | if ([url rangeOfString:@"code="].length != 0) { 62 | 63 | NSHTTPCookie *cookie; 64 | NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; 65 | for (cookie in [storage cookies]) { 66 | if ([[cookie domain] isEqualToString:@"foursquare.com"]) { 67 | [storage deleteCookie:cookie]; 68 | } 69 | } 70 | 71 | NSArray *array = [url componentsSeparatedByString:@"="]; 72 | 73 | [self startLoading:YES withTint:TJTintWhite]; 74 | 75 | dispatch_async(dispatch_get_global_queue(0, 0), ^{ 76 | NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://foursquare.com/oauth2/access_token?client_id=%@&client_secret=%@&grant_type=authorization_code&redirect_uri=%@&code=%@", [CIFoursquareEngine clientID], [CIFoursquareEngine clientSecret], [CIFoursquareEngine callbackURL], [array objectAtIndex:1]]]]; 77 | 78 | // TODO: Error checking... 79 | 80 | NSDictionary *result = [[JSONDecoder decoder] objectWithData:data]; 81 | 82 | if ([result valueForKey:@"access_token"]) { 83 | [[NSUserDefaults standardUserDefaults] setObject:[result valueForKey:@"access_token"] forKey:@"token"]; 84 | [[NSUserDefaults standardUserDefaults] synchronize]; 85 | 86 | dispatch_sync(dispatch_get_main_queue(), ^{ 87 | [self succeed]; 88 | }); 89 | } else { 90 | dispatch_sync(dispatch_get_main_queue(), ^{ 91 | [self fail]; 92 | }); 93 | } 94 | }); 95 | 96 | return NO; 97 | 98 | } else { 99 | if ([url rangeOfString:@"error="].length != 0) { 100 | NSArray *array = [url componentsSeparatedByString:@"="]; 101 | NSString *error = [array objectAtIndex:1]; 102 | NSLog(@"%@", error); 103 | 104 | return NO; 105 | } 106 | } 107 | return YES; 108 | } 109 | 110 | #pragma mark - Finishing 111 | 112 | - (void)succeed { 113 | [self stopLoadingAnimated:YES]; 114 | [activityIndicator stopAnimating]; 115 | 116 | [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:@"login" object:nil]]; 117 | } 118 | 119 | - (void)fail { 120 | [[[[UIAlertView alloc] initWithTitle:@"Error" message:@"Unable to log into foursquare at this time" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] autorelease] show]; 121 | [self stopLoadingAnimated:YES]; 122 | [activityIndicator stopAnimating]; 123 | [[self navigationController] popViewControllerAnimated:YES]; 124 | } 125 | 126 | @end 127 | -------------------------------------------------------------------------------- /Checkie/Chromeless/UIViewController+Loading.m: -------------------------------------------------------------------------------- 1 | // UIViewController+Loading 2 | // Chromeless 3 | // By Tim Johnsen 4 | 5 | #import "UIViewController+Loading.h" 6 | 7 | #define LOADING_TAG -1 8 | #define LOADING_LABEL_TAG -2 9 | #define LOADING_ACTIVITY_INDICATOR_TAG -3 10 | 11 | @implementation UIViewController (Loading) 12 | 13 | #pragma mark - 14 | #pragma mark TJTinting 15 | 16 | - (void)setTint:(TJTint)tint { 17 | 18 | // Setup views 19 | 20 | if ([[self view] viewWithTag:LOADING_TAG] == nil) { 21 | 22 | id loadingView = [[UIView alloc] initWithFrame:[self view].bounds]; 23 | [loadingView setAlpha:0]; 24 | [loadingView setTag:LOADING_TAG]; 25 | [loadingView setAutoresizingMask:UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth]; 26 | [loadingView setUserInteractionEnabled:NO]; 27 | 28 | UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 160, 160)]; 29 | [container setCenter:[(UIView *)loadingView center]]; 30 | [container setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin]; 31 | [loadingView addSubview:container]; 32 | [container setBackgroundColor:[UIColor clearColor]]; 33 | [container release]; 34 | 35 | UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0,0,32,32)]; 36 | [activityIndicator setTag:LOADING_ACTIVITY_INDICATOR_TAG]; 37 | [activityIndicator setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin]; 38 | [activityIndicator setCenter:CGPointMake(80.0f, 80.0f)]; 39 | [activityIndicator startAnimating]; 40 | [container addSubview:activityIndicator]; 41 | [activityIndicator release]; 42 | 43 | UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 80, 160, 80)]; 44 | [label setTag:LOADING_LABEL_TAG]; 45 | [label setBackgroundColor:[UIColor clearColor]]; 46 | [label setText:@"Loading..."]; 47 | [label setClipsToBounds:NO]; 48 | [label setTextAlignment:UITextAlignmentCenter]; 49 | [label setFont:[UIFont boldSystemFontOfSize:[[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone ? 18 : 28]]; 50 | [label setAutoresizingMask:UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin]; 51 | [container addSubview:label]; 52 | [label release]; 53 | 54 | [[self view] addSubview:loadingView]; 55 | [loadingView release]; 56 | } 57 | 58 | // Set Colors 59 | 60 | UIView *loadingView = [[self view] viewWithTag:LOADING_TAG]; 61 | [loadingView setBackgroundColor:tint == TJTintWhite ? [UIColor colorWithRed:1 green:1 blue:1 alpha:.8] : [UIColor colorWithRed:0 green:0 blue:0 alpha:.5]]; 62 | [(UILabel *)[[self view] viewWithTag:LOADING_LABEL_TAG] setTextColor:tint == TJTintWhite ? [UIColor grayColor] : [UIColor whiteColor]]; 63 | UIActivityIndicatorView *activityIndicator = (UIActivityIndicatorView *)[loadingView viewWithTag:LOADING_ACTIVITY_INDICATOR_TAG]; 64 | if ([activityIndicator respondsToSelector:@selector(setColor:)]) { 65 | [activityIndicator setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhiteLarge]; 66 | if (tint == TJTintWhite) { 67 | [activityIndicator performSelector:@selector(setColor:) withObject:[UIColor grayColor]]; 68 | } 69 | } else { 70 | [activityIndicator setActivityIndicatorViewStyle:tint == TJTintWhite ? UIActivityIndicatorViewStyleGray : UIActivityIndicatorViewStyleWhiteLarge]; 71 | } 72 | } 73 | 74 | - (TJTint)tint { 75 | if ([[self view] viewWithTag:LOADING_TAG]) { 76 | return ([[[self view] viewWithTag:LOADING_TAG] backgroundColor] == [UIColor whiteColor]) ? TJTintWhite : TJTintBlack; 77 | } 78 | 79 | return TJTintWhite; 80 | } 81 | 82 | #pragma mark - 83 | #pragma mark Custom 84 | 85 | - (void)startLoading:(BOOL)animated { 86 | [self startLoading:animated withTint:TJTintWhite]; 87 | } 88 | 89 | - (void)startLoading:(BOOL)animated withTint:(TJTint)tint { 90 | 91 | [self setTint:tint]; 92 | [[self view] bringSubviewToFront:[[self view] viewWithTag:LOADING_TAG]]; 93 | 94 | if (animated) { 95 | [UIView beginAnimations:nil context:NULL]; 96 | [UIView setAnimationDuration:.25]; 97 | } 98 | 99 | [[[self view] viewWithTag:LOADING_TAG] setAlpha:1]; 100 | 101 | if (animated) { 102 | [UIView commitAnimations]; 103 | } 104 | } 105 | 106 | - (void)stopLoadingAnimated:(BOOL)animated { 107 | if (animated) { 108 | [UIView beginAnimations:nil context:NULL]; 109 | [UIView setAnimationDuration:.25]; 110 | } 111 | 112 | [[[self view] viewWithTag:LOADING_TAG] setAlpha:0]; 113 | 114 | if(animated) { 115 | [UIView commitAnimations]; 116 | } 117 | } 118 | 119 | @end -------------------------------------------------------------------------------- /Checkie/Chromeless/TJPageControl.m: -------------------------------------------------------------------------------- 1 | // TJPageControl 2 | // Chromeless 3 | // By Tim Johnsen 4 | 5 | #import "TJPageControl.h" 6 | 7 | @implementation TJPageControl 8 | 9 | @synthesize currentPage = _currentPage; 10 | @synthesize numberOfPages = _numberOfPages; 11 | @synthesize delegate = _delegate; 12 | 13 | @synthesize indicatorSize = _indicatorSize; 14 | @synthesize indicatorSpacing = _indicatorSpacing; 15 | @synthesize baseColor = _baseColor; 16 | @synthesize selectedColor = _selectedColor; 17 | @synthesize style = _style; 18 | @synthesize type = _type; 19 | @synthesize alignment = _alignment; 20 | 21 | #pragma mark - 22 | #pragma mark NSObject 23 | 24 | - (id)init { 25 | if (self = [self initWithFrame:CGRectZero]) { 26 | } 27 | return self; 28 | } 29 | 30 | - (void)dealloc { 31 | [_baseColor release]; 32 | [_selectedColor release]; 33 | 34 | _delegate = nil; 35 | 36 | [super dealloc]; 37 | } 38 | 39 | #pragma mark - 40 | #pragma mark UIView 41 | 42 | - (id)initWithFrame:(CGRect)frame { 43 | if ((self = [super initWithFrame:frame])) { 44 | [self setBackgroundColor:[UIColor clearColor]]; 45 | self.currentPage = 0; 46 | self.numberOfPages = 0; 47 | 48 | self.indicatorSize = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone ? 4 : 6; 49 | self.indicatorSpacing = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone ? 10 : 14; 50 | 51 | self.baseColor = [UIColor grayColor]; 52 | self.selectedColor = [UIColor grayColor]; 53 | 54 | self.style = TJPageControlStyleEmptyIndicators; 55 | self.type = TJPageControlTypeCircle; 56 | self.alignment = TJPageControlAlignmentCenter; 57 | } 58 | 59 | return self; 60 | } 61 | 62 | - (void)setFrame:(CGRect)rect { 63 | [super setFrame:rect]; 64 | [self setNeedsDisplay]; 65 | } 66 | 67 | - (void)setNumberOfPages:(int)n { 68 | _numberOfPages = n; 69 | [self setNeedsDisplay]; 70 | } 71 | 72 | - (void)setCurrentPage:(int)n { 73 | _currentPage = n; 74 | 75 | while (self.currentPage >= self.numberOfPages) { 76 | _currentPage--; 77 | } 78 | 79 | while (self.currentPage < 0) { 80 | _currentPage++; 81 | } 82 | 83 | [self setNeedsDisplay]; 84 | } 85 | 86 | - (void)drawRect:(CGRect)rect { 87 | [super drawRect:rect]; 88 | 89 | CGContextRef context = UIGraphicsGetCurrentContext(); 90 | 91 | if (self.numberOfPages > 1) { 92 | 93 | float length = self.numberOfPages * self.indicatorSize + self.indicatorSpacing * (self.numberOfPages - 1); 94 | 95 | float x = rect.size.width / 2, y = rect.size.height / 2; 96 | 97 | if(self.bounds.size.width > self.bounds.size.height){ 98 | y -= self.indicatorSize / 2; 99 | switch (self.alignment) { 100 | case TJPageControlAlignmentCenter: 101 | x -= length / 2; 102 | break; 103 | case TJPageControlAlignmentLeftTop: 104 | x = self.indicatorSpacing; 105 | break; 106 | case TJPageControlAlignmentRightBottom: 107 | x = self.bounds.size.width - length - self.indicatorSpacing; 108 | } 109 | } else { 110 | x -= self.indicatorSize / 2; 111 | 112 | switch (self.alignment) { 113 | case TJPageControlAlignmentCenter: 114 | y -= length / 2; 115 | break; 116 | case TJPageControlAlignmentLeftTop: 117 | y = self.indicatorSpacing; 118 | break; 119 | case TJPageControlAlignmentRightBottom: 120 | y = self.bounds.size.height - length - self.indicatorSpacing; 121 | } 122 | } 123 | 124 | // draw each of the indicators 125 | for (int i = 0 ; i < self.numberOfPages ; i++) { 126 | if (self.style == TJPageControlStyleEmptyIndicators) { 127 | // draw empty indicators 128 | if (i == self.currentPage) { 129 | [self.selectedColor setFill]; 130 | if (self.type == TJPageControlTypeCircle) { 131 | CGContextFillEllipseInRect(context, CGRectMake(x, y, self.indicatorSize, self.indicatorSize)); 132 | } else { 133 | CGContextFillRect(context, CGRectMake(x, y, self.indicatorSize, self.indicatorSize)); 134 | } 135 | } 136 | [self.baseColor setStroke]; 137 | if (self.type == TJPageControlTypeCircle) { 138 | CGContextStrokeEllipseInRect(context, CGRectMake(x, y, self.indicatorSize, self.indicatorSize)); 139 | } else { 140 | CGContextStrokeRect(context, CGRectMake(x, y, self.indicatorSize, self.indicatorSize)); 141 | } 142 | } else { 143 | // draw shaded indicators 144 | if (i == self.currentPage) { 145 | [self.selectedColor setFill]; 146 | } else { 147 | [self.baseColor setFill]; 148 | } 149 | 150 | if (self.type == TJPageControlTypeCircle) { 151 | CGContextFillEllipseInRect(context, CGRectMake(x, y, self.indicatorSize, self.indicatorSize)); 152 | } else { 153 | CGContextFillRect(context, CGRectMake(x, y, self.indicatorSize, self.indicatorSize)); 154 | } 155 | } 156 | 157 | if (self.bounds.size.width > self.bounds.size.height) { 158 | x += self.indicatorSize + self.indicatorSpacing; 159 | } else { 160 | y += self.indicatorSize + self.indicatorSpacing; 161 | } 162 | } 163 | } 164 | } 165 | 166 | @end 167 | -------------------------------------------------------------------------------- /Checkie/Chromeless/TJSwitch.m: -------------------------------------------------------------------------------- 1 | // TJSwitch 2 | // Chromeless 3 | // By Tim Johnsen 4 | 5 | #import "TJSwitch.h" 6 | 7 | #define INSET 2.0f 8 | 9 | @interface TJSwitch () 10 | 11 | - (void)_tap; 12 | 13 | @end 14 | 15 | @implementation TJSwitch 16 | 17 | #pragma mark - 18 | #pragma mark UIView 19 | 20 | - (id)initWithFrame:(CGRect)frame { 21 | if (self = [self initWithFrame:frame tint:TJTintBlack]) { 22 | } 23 | 24 | return self; 25 | } 26 | 27 | - (void)setFrame:(CGRect)frame { 28 | [super setFrame:CGRectMake(frame.origin.x, frame.origin.y, 94.0f, 27.0f)]; 29 | 30 | } 31 | 32 | - (void)setBounds:(CGRect)bounds { 33 | [super setBounds:CGRectMake(0.0f, 0.0f, 94.0f, 27.0f)]; 34 | } 35 | 36 | - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { 37 | UIView *hit = [super hitTest:point withEvent:event]; 38 | 39 | if ([hit isDescendantOfView:self]) { 40 | return _scrollView; 41 | } 42 | 43 | return hit; 44 | } 45 | 46 | #pragma mark - 47 | #pragma mark UIScrollViewDelegate 48 | 49 | - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { 50 | _cachedState = [self isOn]; 51 | } 52 | 53 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate { 54 | if (!decelerate) { 55 | if (_cachedState != [self isOn]) { 56 | [self sendActionsForControlEvents:UIControlEventValueChanged]; 57 | } 58 | } 59 | } 60 | 61 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { 62 | if (_cachedState != [self isOn]) { 63 | [self sendActionsForControlEvents:UIControlEventValueChanged]; 64 | } 65 | } 66 | 67 | #pragma mark - 68 | #pragma mark UISwitch Emulation 69 | 70 | - (BOOL)isOn { 71 | return _scrollView.contentOffset.x == 0.0f; 72 | } 73 | 74 | - (void)setOn:(BOOL)on animated:(BOOL)animated { 75 | if (on != [self isOn]) { 76 | [self toggle:animated]; 77 | } 78 | } 79 | 80 | #pragma mark - 81 | #pragma mark TJTinting 82 | 83 | - (id)initWithTint:(TJTint)tint { 84 | if ((self = [self initWithFrame:CGRectZero tint:tint])) { 85 | } 86 | 87 | return self; 88 | } 89 | 90 | - (id)initWithFrame:(CGRect)frame tint:(TJTint)tint { 91 | self = [super initWithFrame:frame]; 92 | if (self) { 93 | [super setBounds:CGRectMake(0.0f, 0.0f, 94.0f, 27.0f)]; 94 | 95 | _inside = [[UIView alloc] initWithFrame:CGRectInset(self.bounds, INSET, INSET)]; 96 | [_inside setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight]; 97 | [self addSubview:_inside]; 98 | [_inside release]; 99 | 100 | UILabel *offLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.bounds.size.width / 2.0f, 0.0f, self.bounds.size.width / 2.0f, self.bounds.size.height)]; 101 | [offLabel setText:@"OFF"]; 102 | [offLabel setFont:[UIFont boldSystemFontOfSize:16.0f]]; 103 | [offLabel setBackgroundColor:[UIColor clearColor]]; 104 | [offLabel setTextColor:[UIColor lightGrayColor]]; 105 | [offLabel setTextAlignment:UITextAlignmentCenter]; 106 | [self addSubview:offLabel]; 107 | [offLabel release]; 108 | 109 | _onLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, 0.0f, self.bounds.size.width / 2.0f, self.bounds.size.height)]; 110 | [_onLabel setText:@"ON"]; 111 | [_onLabel setFont:[UIFont boldSystemFontOfSize:16.0f]]; 112 | [_onLabel setBackgroundColor:[UIColor clearColor]]; 113 | [_onLabel setTextAlignment:UITextAlignmentCenter]; 114 | [self addSubview:_onLabel]; 115 | [_onLabel release]; 116 | 117 | _scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(self.bounds.size.width / 2.0f, 0.0f, self.bounds.size.width / 2.0f, self.bounds.size.height)]; 118 | [_scrollView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight]; 119 | [_scrollView setBackgroundColor:[UIColor clearColor]]; 120 | [_scrollView setShowsVerticalScrollIndicator:NO]; 121 | [_scrollView setShowsHorizontalScrollIndicator:NO]; 122 | [_scrollView setContentSize:CGSizeMake(2.0f * _scrollView.bounds.size.width, _scrollView.bounds.size.height)]; 123 | [_scrollView setPagingEnabled:YES]; 124 | [_scrollView setBounces:NO]; 125 | [_scrollView setClipsToBounds:NO]; 126 | [_scrollView setDelegate:self]; 127 | [self addSubview:_scrollView]; 128 | 129 | _nub = [[UIView alloc] initWithFrame:CGRectInset(CGRectMake(0.0f, 0.0f, _scrollView.bounds.size.width, _scrollView.bounds.size.height), INSET * 2.0f, INSET * 2.0f)]; 130 | [_nub setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight]; 131 | [_scrollView addSubview:_nub]; 132 | [_nub release]; 133 | 134 | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_tap)]; 135 | [self addGestureRecognizer:tap]; 136 | [tap release]; 137 | 138 | [self setTint:tint]; 139 | [self setOn:NO animated:NO]; 140 | } 141 | return self; 142 | } 143 | 144 | - (void)setTint:(TJTint)tint { 145 | UIColor *lightColor = (tint == TJTintWhite) ? [UIColor whiteColor] : [UIColor blackColor]; 146 | UIColor *darkColor = (tint == TJTintWhite) ? [UIColor blackColor] : [UIColor whiteColor]; 147 | 148 | [self setBackgroundColor:lightColor]; 149 | [_inside setBackgroundColor:darkColor]; 150 | [_onLabel setTextColor:lightColor]; 151 | [_nub setBackgroundColor:lightColor]; 152 | } 153 | 154 | - (TJTint)tint { 155 | return ([self backgroundColor] == [UIColor whiteColor]) ? TJTintBlack : TJTintWhite; 156 | } 157 | 158 | #pragma mark - 159 | #pragma mark Custom 160 | 161 | - (void)toggle { 162 | [self toggle:YES]; 163 | } 164 | 165 | - (void)toggle:(BOOL)animated { 166 | if (animated) { 167 | [UIView beginAnimations:nil context:nil]; 168 | [UIView setAnimationBeginsFromCurrentState:YES]; 169 | } 170 | if (_scrollView.contentOffset.x == 0.0f) { 171 | [_scrollView setContentOffset:CGPointMake(_scrollView.bounds.size.width, 0.0f)]; 172 | } else { 173 | [_scrollView setContentOffset:CGPointMake(0.0f, 0.0f)]; 174 | } 175 | if (animated) { 176 | [UIView commitAnimations]; 177 | } 178 | } 179 | 180 | #pragma mark - 181 | #pragma mark Private 182 | 183 | - (void)_tap { 184 | [self toggle:YES]; 185 | [self sendActionsForControlEvents:UIControlEventValueChanged]; 186 | } 187 | 188 | @end 189 | -------------------------------------------------------------------------------- /Checkie/Chromeless/UITableView + PullToRefresh.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView + PullToRefresh.m 3 | // Spartan 4 | // 5 | // Created by Tim Johnsen on 12/28/10. 6 | // Copyright 2010 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "UITableView + PullToRefresh.h" 10 | 11 | #define HEADER_HEIGHT ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone ? 60 : 80) 12 | 13 | #define PULL_TO_REFRESH_TAG 500 14 | #define PULL_TO_REFRESH_IMAGE_TAG 501 15 | #define PULL_TO_REFRESH_LABEL_TAG 502 16 | #define PULL_TO_REFRESH_INDICATOR_TAG 503 17 | 18 | #define PULL_TO_REFRESH_TEXT @"Pull to Refresh" 19 | #define RELEASE_TO_REFRESH_TEXT @"Release to Refresh" 20 | #define REFRESHING_TEXT @"Refreshing" 21 | 22 | @protocol PullToRefresh 23 | 24 | - (void)refresh; 25 | 26 | @end 27 | 28 | @implementation UITableView (PullToRefresh) 29 | 30 | BOOL arrowOrientation; 31 | 32 | -(void)setupPullToRefresh{ 33 | [self setupPullToRefreshWithTint:TJPullToRefreshTintDark]; 34 | } 35 | 36 | -(void)setupPullToRefreshWithTint:(TJPullToRefreshTint)tint{ 37 | UIView *headerView = nil; 38 | if([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone){ 39 | headerView = [[UIView alloc] initWithFrame:CGRectMake(0, - HEADER_HEIGHT, self.bounds.size.width, HEADER_HEIGHT)]; 40 | [headerView setAutoresizingMask:UIViewAutoresizingFlexibleWidth]; 41 | } 42 | else{ 43 | headerView = [[UIView alloc] initWithFrame:CGRectMake(self.bounds.size.width / 2 - 160, - HEADER_HEIGHT, 320, HEADER_HEIGHT)]; 44 | [headerView setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin]; 45 | } 46 | 47 | [headerView setTag:PULL_TO_REFRESH_TAG]; 48 | [headerView setBackgroundColor:[UIColor clearColor]]; 49 | 50 | UILabel *headerLabel = [[UILabel alloc] initWithFrame:[headerView bounds]]; 51 | [headerLabel setBackgroundColor:[UIColor clearColor]]; 52 | [headerLabel setTextAlignment:UITextAlignmentCenter]; 53 | [headerLabel setAutoresizingMask:UIViewAutoresizingFlexibleWidth]; 54 | [headerLabel setText:PULL_TO_REFRESH_TEXT]; 55 | if(tint == TJPullToRefreshTintDark) 56 | [headerLabel setTextColor:[UIColor blackColor]]; 57 | else 58 | [headerLabel setTextColor:[UIColor whiteColor]]; 59 | [headerLabel setTag:PULL_TO_REFRESH_LABEL_TAG]; 60 | [headerLabel setFont:[UIFont boldSystemFontOfSize:[[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone ? 14 : 20]]; 61 | [headerView addSubview:[headerLabel autorelease]]; 62 | [self addSubview:[headerView autorelease]]; 63 | 64 | UIActivityIndicatorView *indicator; 65 | if(tint == TJPullToRefreshTintDark) 66 | indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; 67 | else 68 | indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; 69 | [indicator setCenter:CGPointMake(HEADER_HEIGHT / 2, HEADER_HEIGHT / 2)]; 70 | [indicator setTag:PULL_TO_REFRESH_INDICATOR_TAG]; 71 | [indicator startAnimating]; 72 | [indicator setHidesWhenStopped:NO]; 73 | [headerView addSubview:[indicator autorelease]]; 74 | [indicator setHidden:YES]; 75 | 76 | UIImageView *image; 77 | if(tint == TJPullToRefreshTintDark) 78 | image = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pullToRefresh.png"]]; 79 | else 80 | image = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pullToRefreshLight.png"]]; 81 | [image setBackgroundColor:[UIColor clearColor]]; 82 | [image setFrame:CGRectMake(0, 0, HEADER_HEIGHT, HEADER_HEIGHT)]; 83 | [image setContentMode:UIViewContentModeCenter]; 84 | [image setTag:PULL_TO_REFRESH_IMAGE_TAG]; 85 | [image setAlpha:.5]; 86 | [headerView addSubview:[image autorelease]]; 87 | } 88 | 89 | -(void)removePullToRefresh{ 90 | [[self viewWithTag:PULL_TO_REFRESH_TAG] removeFromSuperview]; 91 | } 92 | 93 | -(BOOL)hasPullToRefresh{ 94 | return [self viewWithTag:PULL_TO_REFRESH_TAG] != nil; 95 | } 96 | 97 | -(void)scrollViewDidScroll:(UIScrollView *)scrollView{ 98 | 99 | if(scrollView.contentOffset.y < 0 && ![self isLoading]){ 100 | 101 | if(scrollView.contentOffset.y < - HEADER_HEIGHT){ 102 | [(UILabel *)[[self viewWithTag:PULL_TO_REFRESH_TAG] viewWithTag:PULL_TO_REFRESH_LABEL_TAG] setText:RELEASE_TO_REFRESH_TEXT]; 103 | 104 | if(!arrowOrientation){ 105 | [UIView beginAnimations:nil context:NULL]; 106 | [UIView setAnimationBeginsFromCurrentState:YES]; 107 | [[[self viewWithTag:PULL_TO_REFRESH_TAG] viewWithTag:PULL_TO_REFRESH_IMAGE_TAG] setTransform:CGAffineTransformMakeRotation(-M_PI)]; 108 | [[[self viewWithTag:PULL_TO_REFRESH_TAG] viewWithTag:PULL_TO_REFRESH_IMAGE_TAG] setAlpha:1]; 109 | [UIView commitAnimations]; 110 | arrowOrientation = YES; 111 | } 112 | } 113 | else{ 114 | [(UILabel *)[[self viewWithTag:PULL_TO_REFRESH_TAG] viewWithTag:PULL_TO_REFRESH_LABEL_TAG] setText:PULL_TO_REFRESH_TEXT]; 115 | 116 | if(arrowOrientation){ 117 | [UIView beginAnimations:nil context:NULL]; 118 | [UIView setAnimationBeginsFromCurrentState:YES]; 119 | [[[self viewWithTag:PULL_TO_REFRESH_TAG] viewWithTag:PULL_TO_REFRESH_IMAGE_TAG] setTransform:CGAffineTransformMakeRotation(0)]; 120 | [[[self viewWithTag:PULL_TO_REFRESH_TAG] viewWithTag:PULL_TO_REFRESH_IMAGE_TAG] setAlpha:.5]; 121 | [UIView commitAnimations]; 122 | arrowOrientation = NO; 123 | } 124 | } 125 | } 126 | } 127 | 128 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{ 129 | if(scrollView.contentOffset.y < - HEADER_HEIGHT && ![self isLoading] && [self viewWithTag:PULL_TO_REFRESH_TAG] != nil) 130 | [self startLoading]; 131 | } 132 | 133 | -(void)startLoading{ 134 | 135 | [UIView beginAnimations:nil context:NULL]; 136 | [UIView setAnimationBeginsFromCurrentState:YES]; 137 | [UIView setAnimationDuration:0.3]; 138 | 139 | [[[self viewWithTag:PULL_TO_REFRESH_TAG] viewWithTag:PULL_TO_REFRESH_IMAGE_TAG] setHidden:YES]; 140 | [[[self viewWithTag:PULL_TO_REFRESH_TAG] viewWithTag:PULL_TO_REFRESH_INDICATOR_TAG] setHidden:NO]; 141 | 142 | [self setContentInset:UIEdgeInsetsMake(HEADER_HEIGHT, 0, -736, 0)]; 143 | 144 | [(UILabel *)[[self viewWithTag:PULL_TO_REFRESH_TAG] viewWithTag:PULL_TO_REFRESH_LABEL_TAG] setText:REFRESHING_TEXT]; 145 | 146 | [UIView commitAnimations]; 147 | 148 | if([[self delegate] respondsToSelector:@selector(refresh)]) 149 | [(id)[self delegate] refresh]; 150 | } 151 | 152 | -(void)stopLoading{ 153 | 154 | [UIView beginAnimations:nil context:NULL]; 155 | [UIView setAnimationBeginsFromCurrentState:YES]; 156 | [UIView setAnimationDuration:0.3]; 157 | 158 | [self setContentInset:UIEdgeInsetsMake(0, 0, -736, 0)]; 159 | // [self isLoading] = NO; 160 | 161 | [(UILabel *)[[self viewWithTag:PULL_TO_REFRESH_TAG] viewWithTag:PULL_TO_REFRESH_LABEL_TAG] setText:PULL_TO_REFRESH_TEXT]; 162 | [[[self viewWithTag:PULL_TO_REFRESH_TAG] viewWithTag:PULL_TO_REFRESH_IMAGE_TAG] setTransform:CGAffineTransformMakeRotation(0)]; 163 | [[[self viewWithTag:PULL_TO_REFRESH_TAG] viewWithTag:PULL_TO_REFRESH_IMAGE_TAG] setAlpha:.5]; 164 | 165 | [UIView commitAnimations]; 166 | 167 | [NSTimer scheduledTimerWithTimeInterval:0.3 target:self selector:@selector(finishLoading) userInfo:nil repeats:NO]; 168 | } 169 | 170 | -(BOOL)isLoading{ 171 | return [[[self viewWithTag:PULL_TO_REFRESH_TAG] viewWithTag:PULL_TO_REFRESH_IMAGE_TAG] isHidden]; 172 | } 173 | 174 | //-(void)startLoading{ 175 | // [[self viewWithTag:PULL_TO_REFRESH_TAG] setHidden:YES]; 176 | // 177 | // if([[self delegate] respondsToSelector:@selector(refresh)]) 178 | // [(id)[self delegate] refresh]; 179 | //} 180 | // 181 | //-(void)stopLoading{ 182 | // [[[self viewWithTag:PULL_TO_REFRESH_TAG] viewWithTag:PULL_TO_REFRESH_IMAGE_TAG] setTransform:CGAffineTransformIdentity]; 183 | // [[[self viewWithTag:PULL_TO_REFRESH_TAG] viewWithTag:PULL_TO_REFRESH_IMAGE_TAG] setAlpha:.5]; 184 | // [[self viewWithTag:PULL_TO_REFRESH_TAG] setHidden:NO]; 185 | //} 186 | 187 | -(void)finishLoading{ 188 | [[[self viewWithTag:PULL_TO_REFRESH_TAG] viewWithTag:PULL_TO_REFRESH_IMAGE_TAG] setHidden:NO]; 189 | [[[self viewWithTag:PULL_TO_REFRESH_TAG] viewWithTag:PULL_TO_REFRESH_INDICATOR_TAG] setHidden:YES]; 190 | [self scrollViewDidScroll:self]; 191 | } 192 | 193 | -(void)refresh{ 194 | } 195 | 196 | @end 197 | -------------------------------------------------------------------------------- /Checkie/CIFoursquareEngine.m: -------------------------------------------------------------------------------- 1 | #import "CIFoursquareEngine.h" 2 | #import "CIVenue.h" 3 | #import "JSONKit.h" 4 | 5 | #warning Foursquare OAuth token has been omitted from the open source version of Checkie 6 | #define OAUTH_TOKEN @"[ REDACTED ]" 7 | 8 | @interface CIFoursquareEngine () 9 | 10 | - (NSOperationQueue *)_queue; 11 | 12 | @end 13 | 14 | @implementation CIFoursquareEngine 15 | 16 | @synthesize checkingInVenue; 17 | @synthesize checkedInVenue; 18 | @synthesize checkedInPoints; 19 | 20 | #pragma mark - 21 | #pragma mark Location Monitoring 22 | 23 | - (CLLocationManager *)locationManager { 24 | static CLLocationManager *manager = nil; 25 | 26 | static dispatch_once_t onceToken; 27 | dispatch_once(&onceToken, ^{ 28 | dispatch_sync(dispatch_get_main_queue(), ^{ 29 | manager = [[CLLocationManager alloc] init]; 30 | [manager startUpdatingLocation]; 31 | }); 32 | }); 33 | 34 | return manager; 35 | } 36 | 37 | #pragma mark - 38 | #pragma mark Actions 39 | 40 | - (void)getNearbyVenuesWithSearchString:(NSString *)searchString andCallback:(void (^)(NSArray *results))callback { 41 | [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES]; 42 | 43 | [[self _queue] addOperationWithBlock:^{ 44 | 45 | // Stall while grabbing location or while there is no user 46 | while (!([CIFoursquareEngine token] && [[self locationManager] location])) { 47 | [NSThread sleepForTimeInterval:0.1f]; 48 | } 49 | 50 | [NSThread sleepForTimeInterval:1.0f]; 51 | 52 | NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:[[NSString stringWithFormat:@"https://api.foursquare.com/v2/venues/search?ll=%f,%f&intent=checkin&%@oauth_token=%@&v=20120129", [self locationManager].location.coordinate.latitude, [self locationManager].location.coordinate.longitude, searchString ? [NSString stringWithFormat:@"query=%@&", searchString] : @"", [CIFoursquareEngine token]] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]; 53 | NSMutableArray *venues = [[NSMutableArray alloc] init]; 54 | 55 | if (data) { 56 | NSArray *response = [[[JSONDecoder decoder] objectWithData:data] valueForKeyPath:@"response.venues"]; 57 | 58 | for (NSDictionary *dict in response) { 59 | CIVenue *venue = [CIVenue venueFromDictionary:dict]; 60 | 61 | if (venue.uniqueID) { 62 | [venues addObject:venue]; 63 | } 64 | } 65 | } 66 | 67 | if (callback) { 68 | dispatch_sync(dispatch_get_main_queue(), ^{ 69 | callback(venues); 70 | }); 71 | } 72 | 73 | [venues autorelease]; 74 | 75 | [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; 76 | }]; 77 | } 78 | 79 | - (void)checkInAtVenue:(CIVenue *)venue withCallback:(void (^)(BOOL result))callback { 80 | self.checkingInVenue = venue; 81 | 82 | [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES]; 83 | 84 | UIBackgroundTaskIdentifier task = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{}]; 85 | 86 | [[self _queue] addOperationWithBlock:^{ 87 | 88 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://api.foursquare.com/v2/checkins/add?venueId=%@&oauth_token=%@", venue.uniqueID, [CIFoursquareEngine token]]]]; 89 | [request setHTTPMethod:@"POST"]; 90 | 91 | NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil]; 92 | 93 | id object = nil; 94 | if (data) { 95 | object = [[JSONDecoder decoder] objectWithData:data]; 96 | } 97 | 98 | dispatch_sync(dispatch_get_main_queue(), ^{ 99 | BOOL success = ([[object valueForKey:@"meta"] valueForKey:@"code"] && [[[object valueForKey:@"meta"] valueForKey:@"code"] intValue] == 200); 100 | 101 | if (success) { 102 | self.checkedInVenue = venue; 103 | 104 | int points = 0; 105 | for (NSDictionary *dict in [object valueForKey:@"notifications"]) { 106 | if ([[dict valueForKey:@"type"] isEqualToString:@"score"]) { 107 | dict = [dict valueForKey:@"item"]; 108 | for (NSDictionary *score in [dict valueForKey:@"scores"]) { 109 | points += [[score valueForKey:@"points"] intValue]; 110 | } 111 | } 112 | } 113 | 114 | self.checkedInPoints = points; 115 | } 116 | self.checkingInVenue = nil; 117 | 118 | callback(success); 119 | }); 120 | 121 | [[UIApplication sharedApplication] endBackgroundTask:task]; 122 | [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; 123 | }]; 124 | } 125 | 126 | - (void)updateLastCheckedInVenueWithCallback:(void (^)(CIVenue *result))callback { 127 | [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES]; 128 | 129 | UIBackgroundTaskIdentifier task = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{}]; 130 | 131 | [[self _queue] addOperationWithBlock:^{ 132 | 133 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://api.foursquare.com/v2/users/self/checkins?limit=1&oauth_token=%@", [CIFoursquareEngine token]]]]; 134 | [request setHTTPMethod:@"GET"]; 135 | 136 | NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil]; 137 | 138 | id object = nil; 139 | if (data) { 140 | object = [[JSONDecoder decoder] objectWithData:data]; 141 | } 142 | 143 | dispatch_sync(dispatch_get_main_queue(), ^{ 144 | BOOL success = ([[object valueForKey:@"meta"] valueForKey:@"code"] && [[[object valueForKey:@"meta"] valueForKey:@"code"] intValue] == 200); 145 | 146 | CIVenue *venue = nil; 147 | 148 | if (success) { 149 | NSDictionary *dict = [[[[[object valueForKey:@"response"] valueForKey:@"checkins"] objectForKey:@"items"] lastObject] objectForKey:@"venue"]; 150 | if (dict) { 151 | venue = [CIVenue venueFromDictionary:dict]; 152 | if (![self.checkedInVenue isEqual:venue]) { 153 | self.checkedInPoints = 0; 154 | } 155 | self.checkedInVenue = venue; 156 | } 157 | } 158 | 159 | if (callback) { 160 | callback(venue); 161 | } 162 | }); 163 | 164 | [[UIApplication sharedApplication] endBackgroundTask:task]; 165 | [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; 166 | }]; 167 | } 168 | 169 | #pragma mark - 170 | #pragma mark Getters 171 | 172 | - (void)getVenueWithID:(NSString *)uniqueID andCallback:(void (^)(CIVenue *venue))callback { 173 | [[self _queue] addOperationWithBlock:^{ 174 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://api.foursquare.com/v2/venues/%@?oauth_token=%@", uniqueID, [CIFoursquareEngine token]]]]; 175 | [request setHTTPMethod:@"GET"]; 176 | 177 | NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil]; 178 | 179 | id object = nil; 180 | if (data) { 181 | object = [[JSONDecoder decoder] objectWithData:data]; 182 | } 183 | 184 | dispatch_sync(dispatch_get_main_queue(), ^{ 185 | BOOL success = ([[object valueForKey:@"meta"] valueForKey:@"code"] && [[[object valueForKey:@"meta"] valueForKey:@"code"] intValue] == 200); 186 | 187 | CIVenue *venue = nil; 188 | 189 | if (success) { 190 | NSDictionary *dict = [[object valueForKey:@"response"] valueForKey:@"venue"]; 191 | if (dict) { 192 | venue = [CIVenue venueFromDictionary:dict]; 193 | } 194 | } 195 | 196 | if (callback) { 197 | callback(venue); 198 | } 199 | }); 200 | 201 | [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; 202 | }]; 203 | } 204 | 205 | #pragma mark - 206 | #pragma mark State Checking 207 | 208 | - (BOOL)isCurrentlyCheckedInAtVenue:(CIVenue *)venue { 209 | return [venue isEqual:self.checkedInVenue]; 210 | } 211 | 212 | - (BOOL)isCheckingInAtVenue:(CIVenue *)venue { 213 | return [venue isEqual:self.checkingInVenue]; 214 | } 215 | 216 | #pragma mark - 217 | #pragma mark Class Methods 218 | 219 | + (CIFoursquareEngine *)sharedEngine { 220 | static CIFoursquareEngine *shared = nil; 221 | 222 | static dispatch_once_t onceToken; 223 | dispatch_once(&onceToken, ^{ 224 | shared = [[CIFoursquareEngine alloc] init]; 225 | }); 226 | 227 | return shared; 228 | } 229 | 230 | + (NSString *)clientID { 231 | #warning Foursquare client ID omitted from open source version of Checkie 232 | return @"[ READCTED ]"; 233 | } 234 | 235 | + (NSString *)clientSecret { 236 | #warning Foursquare client secret omitted from open source version of Checkie 237 | return @"[ REDACTED ]"; 238 | } 239 | 240 | + (NSString *)callbackURL { 241 | return @"http://www.google.com"; 242 | } 243 | 244 | + (BOOL)isLoggedIn { 245 | return ([CIFoursquareEngine token] != nil); 246 | } 247 | 248 | + (NSString *)token { 249 | return [[NSUserDefaults standardUserDefaults] objectForKey:@"token"]; 250 | } 251 | 252 | - (void)logout { 253 | [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"token"]; 254 | [[NSUserDefaults standardUserDefaults] synchronize]; 255 | 256 | self.checkingInVenue = nil; 257 | self.checkedInVenue = nil; 258 | 259 | [[NSNotificationCenter defaultCenter] postNotificationName:@"logout" object:nil]; 260 | } 261 | 262 | #pragma mark - 263 | #pragma mark Private 264 | 265 | - (NSOperationQueue *)_queue { 266 | static NSOperationQueue *queue = nil; 267 | 268 | static dispatch_once_t onceToken; 269 | dispatch_once(&onceToken, ^{ 270 | queue = [[NSOperationQueue alloc] init]; 271 | [queue setMaxConcurrentOperationCount:5]; 272 | }); 273 | 274 | return queue; 275 | } 276 | 277 | @end 278 | -------------------------------------------------------------------------------- /Checkie/CILogInViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 11C74 6 | 1938 7 | 1138.23 8 | 567.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 933 12 | 13 | 14 | YES 15 | IBUIWebView 16 | IBUIButton 17 | IBUIActivityIndicatorView 18 | IBUIView 19 | IBProxyObject 20 | 21 | 22 | YES 23 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 24 | 25 | 26 | PluginDependencyRecalculationVersion 27 | 28 | 29 | 30 | YES 31 | 32 | IBFilesOwner 33 | IBCocoaTouchFramework 34 | 35 | 36 | IBFirstResponder 37 | IBCocoaTouchFramework 38 | 39 | 40 | 41 | 274 42 | 43 | YES 44 | 45 | 46 | 274 47 | {{0, 44}, {320, 416}} 48 | 49 | 50 | 51 | _NS:677 52 | 53 | 1 54 | MSAxIDEAA 55 | 56 | IBCocoaTouchFramework 57 | 1 58 | YES 59 | 60 | 61 | 62 | -2147483356 63 | {{280, 13}, {20, 20}} 64 | 65 | 66 | 67 | _NS:989 68 | NO 69 | IBCocoaTouchFramework 70 | 2 71 | 72 | 73 | 74 | 292 75 | {{14, 4}, {185, 37}} 76 | 77 | 78 | 79 | _NS:225 80 | NO 81 | IBCocoaTouchFramework 82 | 0 83 | 0 84 | Sign in to foursquare 85 | 86 | 3 87 | MC42NjY2NjY2NjY3AA 88 | 89 | 90 | 91 | 1 92 | MCAwIDAAA 93 | 94 | 95 | 3 96 | MC41AA 97 | 98 | 99 | 2 100 | 18 101 | 102 | 103 | Helvetica-Bold 104 | 18 105 | 16 106 | 107 | 108 | 109 | {{0, 20}, {320, 460}} 110 | 111 | 112 | 113 | 114 | 3 115 | MQA 116 | 117 | 2 118 | 119 | 120 | 121 | 2 122 | 123 | IBCocoaTouchFramework 124 | 125 | 126 | 127 | 128 | YES 129 | 130 | 131 | view 132 | 133 | 134 | 135 | 9 136 | 137 | 138 | 139 | activityIndicator 140 | 141 | 142 | 143 | 11 144 | 145 | 146 | 147 | webView 148 | 149 | 150 | 151 | 12 152 | 153 | 154 | 155 | delegate 156 | 157 | 158 | 159 | 13 160 | 161 | 162 | 163 | goToSignInPage 164 | 165 | 166 | 7 167 | 168 | 16 169 | 170 | 171 | 172 | 173 | YES 174 | 175 | 0 176 | 177 | YES 178 | 179 | 180 | 181 | 182 | 183 | -1 184 | 185 | 186 | File's Owner 187 | 188 | 189 | -2 190 | 191 | 192 | 193 | 194 | 4 195 | 196 | 197 | YES 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 5 206 | 207 | 208 | 209 | 210 | 6 211 | 212 | 213 | 214 | 215 | 15 216 | 217 | 218 | 219 | 220 | 221 | 222 | YES 223 | 224 | YES 225 | -1.CustomClassName 226 | -1.IBPluginDependency 227 | -2.CustomClassName 228 | -2.IBPluginDependency 229 | 15.IBPluginDependency 230 | 15.IBUIButtonInspectorSelectedStateConfigurationMetadataKey 231 | 4.IBPluginDependency 232 | 5.IBPluginDependency 233 | 6.IBPluginDependency 234 | 235 | 236 | YES 237 | CILogInViewController 238 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 239 | UIResponder 240 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 241 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 242 | 243 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 244 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 245 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 246 | 247 | 248 | 249 | YES 250 | 251 | 252 | 253 | 254 | 255 | YES 256 | 257 | 258 | 259 | 260 | 16 261 | 262 | 263 | 264 | YES 265 | 266 | CILogInViewController 267 | UIViewController 268 | 269 | goToSignInPage 270 | id 271 | 272 | 273 | goToSignInPage 274 | 275 | goToSignInPage 276 | id 277 | 278 | 279 | 280 | YES 281 | 282 | YES 283 | activityIndicator 284 | titleLabel 285 | webView 286 | 287 | 288 | YES 289 | UIActivityIndicatorView 290 | UILabel 291 | UIWebView 292 | 293 | 294 | 295 | YES 296 | 297 | YES 298 | activityIndicator 299 | titleLabel 300 | webView 301 | 302 | 303 | YES 304 | 305 | activityIndicator 306 | UIActivityIndicatorView 307 | 308 | 309 | titleLabel 310 | UILabel 311 | 312 | 313 | webView 314 | UIWebView 315 | 316 | 317 | 318 | 319 | IBProjectSource 320 | ./Classes/CILogInViewController.h 321 | 322 | 323 | 324 | 325 | 0 326 | IBCocoaTouchFramework 327 | 328 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 329 | 330 | 331 | YES 332 | 3 333 | 933 334 | 335 | 336 | -------------------------------------------------------------------------------- /Checkie/CIVenuesTableViewController.m: -------------------------------------------------------------------------------- 1 | #import "CIVenuesTableViewController.h" 2 | #import "CIVenueViewController.h" 3 | #import "CISettingsViewController.h" 4 | #import "CIVenueCell.h" 5 | #import "CICheckInCell.h" 6 | #import "CIAlertView.h" 7 | #import "UITableView + PullToRefresh.h" 8 | 9 | const NSString *kCISearchObject = @"search"; 10 | const NSString *kCICheckInObject = @"checkIn"; 11 | const NSString *kCISettingsObject = @"settings"; 12 | 13 | const NSString *kCITypeKey = @"type"; 14 | const NSString *kCIVenueKey = @"venue"; 15 | 16 | @interface CIVenuesTableViewController () 17 | 18 | - (void)_longPressed:(UIGestureRecognizer *)gestureRecognizer; 19 | - (void)tableView:(UITableView *)tableView didLongPressRowAtIndexPath:(NSIndexPath *)indexPath; 20 | 21 | @end 22 | 23 | @implementation CIVenuesTableViewController 24 | 25 | @synthesize cellObjects; 26 | 27 | #pragma mark - 28 | #pragma mark NSObject 29 | 30 | - (void)dealloc { 31 | self.cellObjects = nil; 32 | [_searchField setDelegate:nil]; 33 | [_searchField release]; 34 | 35 | [super dealloc]; 36 | } 37 | 38 | #pragma mark - 39 | #pragma mark UIViewController 40 | 41 | - (void)loadView { 42 | [super loadView]; 43 | 44 | [[self tableView] setupPullToRefresh]; 45 | [[self tableView] setContentInset:UIEdgeInsetsMake(0, 0, -736, 0)]; // hack for settings button, also in PTR 46 | 47 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(login:) name:@"login" object:nil]; 48 | } 49 | 50 | - (void)viewDidLoad { 51 | [super viewDidLoad]; 52 | 53 | if (!self.cellObjects) { 54 | [self refresh]; 55 | } 56 | } 57 | 58 | - (void)viewDidUnload { 59 | [super viewDidUnload]; 60 | 61 | [_searchField setDelegate:nil]; 62 | [_searchField release]; 63 | } 64 | 65 | #pragma mark - 66 | #pragma mark UIScrollViewDelegate 67 | 68 | - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { 69 | if ([_searchField isFirstResponder]) { 70 | [_searchField resignFirstResponder]; 71 | } 72 | } 73 | 74 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate { 75 | [[self tableView] scrollViewDidEndDragging:scrollView willDecelerate:decelerate]; 76 | } 77 | 78 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 79 | [[self tableView] scrollViewDidScroll:scrollView]; 80 | } 81 | 82 | #pragma mark - 83 | #pragma mark UITableViewDataSource 84 | 85 | - (int)numberOfSectionsInTableView:(UITableView *)tableView { 86 | return 3; 87 | } 88 | 89 | - (int)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 90 | switch (section) { 91 | case 0: 92 | return 1; 93 | case 1: 94 | return [self.cellObjects count]; 95 | case 2: 96 | return 1; 97 | } 98 | 99 | return 0; 100 | } 101 | 102 | #pragma mark - 103 | #pragma mark UITableViewDelegate 104 | 105 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 106 | if (indexPath.section == 0) { 107 | 108 | [_searchField becomeFirstResponder]; 109 | 110 | } else if (indexPath.section == 1) { 111 | 112 | [_searchField resignFirstResponder]; 113 | 114 | id object = [self objectForIndexPath:indexPath]; 115 | 116 | if ([object isKindOfClass:[CIVenue class]] && ![[CIFoursquareEngine sharedEngine] isCurrentlyCheckedInAtVenue:(CIVenue *)object] && ![[CIFoursquareEngine sharedEngine] isCheckingInAtVenue:(CIVenue *)object]) { 117 | 118 | // Deselect the cell 119 | [[self tableView] deselectRowAtIndexPath:indexPath animated:YES]; 120 | 121 | // Check in! 122 | [self checkInAtVenue:(CIVenue *)object]; 123 | 124 | } else { 125 | [[self tableView] deselectRowAtIndexPath:indexPath animated:YES]; 126 | } 127 | } 128 | } 129 | 130 | #pragma mark - 131 | #pragma mark Special Cell Operations 132 | 133 | - (void)_longPressed:(UIGestureRecognizer *)gestureRecognizer { 134 | 135 | return; 136 | 137 | if ([gestureRecognizer state] == UIGestureRecognizerStateBegan) { 138 | [self tableView:[self tableView] didLongPressRowAtIndexPath:[[self tableView] indexPathForCell:(UITableViewCell *)[gestureRecognizer view]]]; 139 | } 140 | } 141 | 142 | - (void)tableView:(UITableView *)tableView didLongPressRowAtIndexPath:(NSIndexPath *)indexPath { 143 | id object = [self objectForIndexPath:indexPath]; 144 | 145 | if ([object isKindOfClass:[CIVenue class]]) { 146 | [[self navigationController] pushViewController:[[[CIVenueViewController alloc] initWithVenue:object] autorelease] animated:YES]; 147 | } 148 | } 149 | 150 | #pragma mark - 151 | #pragma mark UITextFieldDelegate 152 | 153 | - (BOOL)textFieldShouldReturn:(UITextField *)textField { 154 | [textField resignFirstResponder]; 155 | 156 | // start searching... 157 | if ([textField text] && ![[[textField text] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] isEqualToString:@""]) { 158 | [self refreshWithSearch:YES]; 159 | } 160 | 161 | return NO; 162 | } 163 | 164 | #pragma mark - 165 | #pragma mark CITableViewController 166 | 167 | - (id)objectForIndexPath:(NSIndexPath *)indexPath { 168 | switch (indexPath.section) { 169 | case 0: 170 | return kCISearchObject; 171 | case 1: 172 | return [self.cellObjects objectAtIndex:indexPath.row]; 173 | case 2: 174 | return kCISettingsObject; 175 | } 176 | return nil; 177 | } 178 | 179 | - (CGFloat)heightForObject:(id)object { 180 | if ([object isEqual:kCISearchObject]) { 181 | return 44.0f; 182 | } else if ([object isEqual:kCISettingsObject]) { 183 | return 780.0f; 184 | } else if ([object isKindOfClass:[NSDictionary class]] && [[object valueForKey:(NSString *)kCITypeKey] isEqual:kCICheckInObject]) { 185 | return [CICheckInCell height]; 186 | } else if ([object isKindOfClass:[CIVenue class]]) { 187 | return [CIVenueCell heightWithVenue:object]; 188 | } 189 | 190 | return [super heightForObject:object]; 191 | } 192 | 193 | - (UITableViewCell *)cellForObject:(id)object { 194 | if ([object isEqual:kCISearchObject]) { 195 | UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:(NSString *)kCISearchObject]; 196 | if (!cell) { 197 | cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:(NSString *)kCISearchObject] autorelease]; 198 | [cell setSelectionStyle:UITableViewCellSelectionStyleNone]; 199 | [cell setBackgroundColor:[UIColor blackColor]]; 200 | [[cell contentView] setBackgroundColor:[UIColor blackColor]]; 201 | 202 | UIImageView *search = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"search"]]; 203 | [search setFrame:CGRectMake(0.0f, 0.0f, 44.0f, 44.0f)]; 204 | [search setContentMode:UIViewContentModeCenter]; 205 | [search setAutoresizingMask:UIViewAutoresizingFlexibleRightMargin]; 206 | [cell addSubview:search]; 207 | [search release]; 208 | } 209 | 210 | if (!_searchField) { 211 | _searchField = [[UITextField alloc] initWithFrame:CGRectMake(44.0f, 3.0f, self.view.bounds.size.width - 44.0f, 38.0f)]; 212 | [_searchField setAutoresizingMask:UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleWidth]; 213 | [_searchField setContentVerticalAlignment:UIControlContentVerticalAlignmentCenter]; 214 | [_searchField setDelegate:self]; 215 | [_searchField setPlaceholder:@"Search..."]; 216 | [_searchField setFont:[UIFont systemFontOfSize:16.0f]]; 217 | [_searchField setKeyboardAppearance:UIKeyboardAppearanceAlert]; 218 | [_searchField setAutocorrectionType:UITextAutocorrectionTypeNo]; 219 | [_searchField setClearButtonMode:UITextFieldViewModeWhileEditing]; 220 | [_searchField setReturnKeyType:UIReturnKeySearch]; 221 | 222 | [_searchField setBackgroundColor:[UIColor blackColor]]; 223 | [_searchField setTextColor:[UIColor whiteColor]]; 224 | } 225 | 226 | [cell addSubview:_searchField]; 227 | 228 | return cell; 229 | } else if ([object isEqual:kCISettingsObject]) { 230 | UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:(NSString *)kCISettingsObject]; 231 | if (!cell) { 232 | cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:(NSString *)kCISettingsObject] autorelease]; 233 | [cell setSelectionStyle:UITableViewCellSelectionStyleNone]; 234 | 235 | UIButton *settingsButton = [[UIButton alloc] init]; 236 | [settingsButton setImage:[UIImage imageNamed:@"settings"] forState:UIControlStateNormal]; 237 | [settingsButton setFrame:CGRectMake(0.0f, 0.0f, 44.0f, 44.0f)]; 238 | [settingsButton setContentMode:UIViewContentModeCenter]; 239 | [settingsButton setAutoresizingMask:UIViewAutoresizingFlexibleRightMargin]; 240 | [settingsButton addTarget:self action:@selector(settings) forControlEvents:UIControlEventTouchUpInside]; 241 | [cell addSubview:settingsButton]; 242 | [settingsButton release]; 243 | } 244 | 245 | return cell; 246 | } else if ([object isKindOfClass:[NSDictionary class]] && [[object valueForKey:(NSString *)kCITypeKey] isEqual:kCICheckInObject]) { 247 | CICheckInCell *cell = [self.tableView dequeueReusableCellWithIdentifier:(NSString *)kCICheckInObject]; 248 | if (!cell) { 249 | cell = [[[CICheckInCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:(NSString *)kCICheckInObject] autorelease]; 250 | } 251 | 252 | [cell setVenue:[object valueForKey:(NSString *)kCIVenueKey]]; 253 | 254 | return cell; 255 | } else if ([object isKindOfClass:[CIVenue class]]) { 256 | CIVenueCell *cell = [self.tableView dequeueReusableCellWithIdentifier:NSStringFromClass([CIVenueCell class])]; 257 | if (!cell) { 258 | cell = [[[CIVenueCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([CIVenueCell class])] autorelease]; 259 | 260 | [cell addGestureRecognizer:[[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(_longPressed:)] autorelease]]; 261 | } 262 | 263 | [cell setVenue:object]; 264 | 265 | return cell; 266 | } 267 | 268 | return nil; 269 | } 270 | 271 | #pragma mark - 272 | #pragma mark UIAlertViewDelegate 273 | 274 | - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex { 275 | if ([[alertView buttonTitleAtIndex:buttonIndex] isEqualToString:@"Retry"]) { 276 | [self checkInAtVenue:[(CIAlertView *)alertView context]]; 277 | } 278 | } 279 | 280 | #pragma mark - 281 | #pragma mark CIVenuesTableViewController 282 | 283 | - (void)refresh { 284 | [self refreshWithSearch:NO]; 285 | } 286 | 287 | - (void)refreshWithSearch:(BOOL)search { 288 | 289 | [[CIFoursquareEngine sharedEngine] updateLastCheckedInVenueWithCallback:^(CIVenue *venue) { 290 | [self updateCellObjects]; 291 | }]; 292 | 293 | // don't allow if open to a venue's details... 294 | 295 | if (!search) { 296 | [_searchField setText:nil]; 297 | } 298 | 299 | [[CIFoursquareEngine sharedEngine] getNearbyVenuesWithSearchString:(search ? _searchField.text : nil) andCallback:^(NSArray *results) { 300 | self.cellObjects = [[results mutableCopy] autorelease]; 301 | 302 | for (int i = 0 ; i < [self.cellObjects count] ; i++) { 303 | if ([[self.cellObjects objectAtIndex:i] isKindOfClass:[CIVenue class]]) { 304 | CIVenue *venue = (CIVenue *)[self.cellObjects objectAtIndex:i]; 305 | // if is checking in here, add cell below 306 | 307 | BOOL isCheckingIn = [[CIFoursquareEngine sharedEngine] isCheckingInAtVenue:venue]; 308 | BOOL isCheckedIn = [[CIFoursquareEngine sharedEngine] isCurrentlyCheckedInAtVenue:venue]; 309 | 310 | if (isCheckedIn || isCheckingIn) { 311 | NSDictionary *object = [NSDictionary dictionaryWithObjectsAndKeys:kCICheckInObject, kCITypeKey, venue, kCIVenueKey, nil]; 312 | if (i == [self.cellObjects count] - 1) { 313 | [self.cellObjects addObject:object]; 314 | } else { 315 | [self.cellObjects insertObject:object atIndex:i + 1]; 316 | } 317 | } 318 | } 319 | } 320 | [[self tableView] reloadData]; 321 | 322 | [[self tableView] stopLoading]; 323 | }]; 324 | } 325 | 326 | - (void)checkInAtVenue:(CIVenue *)venue { 327 | // Start Checking in here 328 | [[CIFoursquareEngine sharedEngine] checkInAtVenue:venue withCallback:^(BOOL result){ 329 | [self updateCellObjects]; 330 | 331 | if (!result) { 332 | if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground) { 333 | // we try non-stop if we're in the background 334 | [self checkInAtVenue:venue]; 335 | } else { 336 | CIAlertView *alertView = [[[CIAlertView alloc] initWithTitle:@"Error" message:[NSString stringWithFormat:@"Failed to check in at %@", [venue name]] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Retry", nil] autorelease]; 337 | [alertView setContext:venue]; 338 | [alertView show]; 339 | } 340 | } 341 | }]; 342 | 343 | // Remove old cells 344 | [self updateCellObjects]; 345 | } 346 | 347 | - (void)updateCellObjects { 348 | 349 | // Perform UITableView alchemy 350 | 351 | [self.tableView beginUpdates]; 352 | 353 | NSMutableArray *objectsToRemove = [[[NSMutableArray alloc] init] autorelease]; 354 | 355 | // Scrub through my list to remove other places that might be getting checked in at 356 | for (int i = 0 ; i < [self.cellObjects count] ; i++) { 357 | id object = [self.cellObjects objectAtIndex:i]; 358 | if ([object isKindOfClass:[NSDictionary class]] && [[object valueForKey:(NSString *)kCITypeKey] isEqual:kCICheckInObject]) { 359 | BOOL isCheckingIn = [[CIFoursquareEngine sharedEngine] isCheckingInAtVenue:[object valueForKey:(NSString *)kCIVenueKey]]; 360 | BOOL isCheckedIn = [[CIFoursquareEngine sharedEngine] isCurrentlyCheckedInAtVenue:[object valueForKey:(NSString *)kCIVenueKey]]; 361 | 362 | if (!isCheckedIn && !isCheckingIn) { 363 | [objectsToRemove addObject:object]; 364 | [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:i inSection:1]] withRowAnimation:UITableViewRowAnimationBottom]; 365 | } else { 366 | [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:i inSection:1]] withRowAnimation:UITableViewRowAnimationNone]; 367 | } 368 | } 369 | } 370 | 371 | // TODO: Do the same for adding cells... 372 | 373 | for (int i = 0 ; i < [self.cellObjects count] ; i++) { 374 | id object = [self.cellObjects objectAtIndex:i]; 375 | if ([object isKindOfClass:[CIVenue class]]) { 376 | CIVenue *venue = (CIVenue *)object; 377 | if ([[[self tableView] cellForRowAtIndexPath:[NSIndexPath indexPathForRow:i inSection:1]] isKindOfClass:[CIVenueCell class]]) { 378 | [(CIVenueCell *)[[self tableView] cellForRowAtIndexPath:[NSIndexPath indexPathForRow:i inSection:1]] update]; 379 | } 380 | 381 | if ([[CIFoursquareEngine sharedEngine] isCurrentlyCheckedInAtVenue:venue] || [[CIFoursquareEngine sharedEngine] isCheckingInAtVenue:venue]) { 382 | id nextObject = i == [self.cellObjects count] - 1 ? nil : [self.cellObjects objectAtIndex:i + 1]; 383 | if (![nextObject isKindOfClass:[NSDictionary class]] || ![[nextObject valueForKey:(NSString *)kCIVenueKey] isEqual:venue]) { 384 | // insert there 385 | NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:kCICheckInObject, kCITypeKey, object, kCIVenueKey, nil]; 386 | if (i == [self.cellObjects count] - 1) { 387 | [self.cellObjects addObject:dict]; 388 | } else { 389 | [self.cellObjects insertObject:dict atIndex:i + 1]; 390 | } 391 | 392 | [[self tableView] insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:i + 1 inSection:1]] withRowAnimation:UITableViewRowAnimationBottom]; 393 | } 394 | } 395 | } 396 | } 397 | 398 | [self.cellObjects removeObjectsInArray:objectsToRemove]; 399 | 400 | [self.tableView endUpdates]; 401 | } 402 | 403 | - (void)settings { 404 | [[self navigationController] pushViewController:[[[CISettingsViewController alloc] init] autorelease] animated:YES]; 405 | } 406 | 407 | #pragma mark - 408 | #pragma mark Observing 409 | 410 | - (void)login:(NSNotification *)notification { 411 | [self refresh]; 412 | [[self tableView] scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:NO]; 413 | } 414 | 415 | @end 416 | -------------------------------------------------------------------------------- /Checkie/CISettingsViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 11C74 6 | 1938 7 | 1138.23 8 | 567.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 933 12 | 13 | 14 | IBUIButton 15 | IBUIImageView 16 | IBUIView 17 | IBUILabel 18 | IBProxyObject 19 | 20 | 21 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 22 | 23 | 24 | PluginDependencyRecalculationVersion 25 | 26 | 27 | 28 | 29 | IBFilesOwner 30 | IBCocoaTouchFramework 31 | 32 | 33 | IBFirstResponder 34 | IBCocoaTouchFramework 35 | 36 | 37 | 38 | 274 39 | 40 | 41 | 42 | 292 43 | {{8, 8}, {64, 30}} 44 | 45 | 46 | 47 | NO 48 | IBCocoaTouchFramework 49 | 0 50 | 0 51 | 0.0 52 | 0.0 53 | 9 54 | 0.0 55 | Back 56 | 57 | 6 58 | System 59 | controlShadowColor 60 | 61 | 3 62 | MC4zMzMzMzMzMzMzAA 63 | 64 | 65 | 66 | 1 67 | MSAxIDEAA 68 | 69 | 70 | 71 | 3 72 | MC41AA 73 | 74 | 75 | NSImage 76 | back.png 77 | 78 | 79 | Helvetica-Bold 80 | Helvetica 81 | 2 82 | 15 83 | 84 | 85 | Helvetica-Bold 86 | 15 87 | 16 88 | 89 | 90 | 91 | 92 | 291 93 | {{80, 12}, {220, 21}} 94 | 95 | 96 | 97 | NO 98 | YES 99 | 7 100 | NO 101 | IBCocoaTouchFramework 102 | Settings 103 | 104 | 1 105 | MCAwIDAAA 106 | 107 | 108 | 3 109 | MQA 110 | 111 | 1 112 | 10 113 | 2 114 | 115 | Helvetica-Bold 116 | Helvetica 117 | 2 118 | 17 119 | 120 | 121 | Helvetica-Bold 122 | 17 123 | 16 124 | 125 | 126 | 127 | 128 | 292 129 | {{20, 358}, {280, 37}} 130 | 131 | 132 | 133 | _NS:225 134 | 135 | NO 136 | IBCocoaTouchFramework 137 | 0 138 | 0 139 | Log Out 140 | 141 | 3 142 | MC42NjY2NjY2NjY3AA 143 | 144 | 145 | 146 | 147 | 148 | 149 | 2 150 | 15 151 | 152 | 153 | 154 | 155 | 156 | 292 157 | {{20, 403}, {280, 37}} 158 | 159 | 160 | 161 | _NS:225 162 | 163 | NO 164 | IBCocoaTouchFramework 165 | 0 166 | 0 167 | Provide Feedback 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 292 179 | {{132, 106}, {57, 57}} 180 | 181 | 182 | 183 | _NS:567 184 | NO 185 | IBCocoaTouchFramework 186 | 187 | NSImage 188 | icon.png 189 | 190 | 191 | 192 | 193 | 292 194 | {{178, 171}, {56, 57}} 195 | 196 | 197 | 198 | _NS:567 199 | 1 200 | NO 201 | IBCocoaTouchFramework 202 | 203 | NSImage 204 | logo.png 205 | 206 | 207 | 208 | 209 | 292 210 | {{87, 189}, {86, 21}} 211 | 212 | 213 | 214 | _NS:328 215 | NO 216 | YES 217 | 7 218 | NO 219 | IBCocoaTouchFramework 220 | Checkie by 221 | 222 | 223 | 1 224 | 10 225 | 226 | 2 227 | 17 228 | 229 | 230 | 231 | 232 | 233 | 292 234 | {{11, 218}, {299, 73}} 235 | 236 | 237 | 238 | _NS:328 239 | NO 240 | YES 241 | 7 242 | NO 243 | IBCocoaTouchFramework 244 | VXNlcyBKU09OS2l0LCBHbHlwaGlzaCwgSWNvbmljLAphbmQgdGhlIGZvdXJzcXVhcmUgQVBJA 245 | 246 | 247 | 1 248 | 10 249 | 0 250 | 1 251 | 252 | 1 253 | 17 254 | 255 | 256 | Helvetica 257 | 17 258 | 16 259 | 260 | 261 | 262 | {{0, 20}, {320, 460}} 263 | 264 | 265 | 266 | 267 | 3 268 | MQA 269 | 270 | 2 271 | 272 | 273 | 274 | 2 275 | 276 | IBCocoaTouchFramework 277 | 278 | 279 | 280 | 281 | 282 | 283 | view 284 | 285 | 286 | 287 | 3 288 | 289 | 290 | 291 | icon 292 | 293 | 294 | 295 | 20 296 | 297 | 298 | 299 | back 300 | 301 | 302 | 7 303 | 304 | 12 305 | 306 | 307 | 308 | logOut 309 | 310 | 311 | 7 312 | 313 | 11 314 | 315 | 316 | 317 | feedback 318 | 319 | 320 | 7 321 | 322 | 21 323 | 324 | 325 | 326 | 327 | 328 | 0 329 | 330 | 331 | 332 | 333 | 334 | 1 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | -1 350 | 351 | 352 | File's Owner 353 | 354 | 355 | -2 356 | 357 | 358 | 359 | 360 | 4 361 | 362 | 363 | 364 | 365 | 5 366 | 367 | 368 | 369 | 370 | 9 371 | 372 | 373 | 374 | 375 | 13 376 | 377 | 378 | 379 | 380 | 15 381 | 382 | 383 | 384 | 385 | 16 386 | 387 | 388 | 389 | 390 | 17 391 | 392 | 393 | 394 | 395 | 18 396 | 397 | 398 | 399 | 400 | 401 | 402 | CISettingsViewController 403 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 404 | UIResponder 405 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 406 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 407 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 408 | 409 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 410 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 411 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 412 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 413 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 414 | 415 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 416 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 417 | 418 | 419 | 420 | 421 | 422 | 423 | 21 424 | 425 | 426 | 427 | 428 | CISettingsViewController 429 | UIViewController 430 | 431 | id 432 | id 433 | id 434 | 435 | 436 | 437 | back 438 | id 439 | 440 | 441 | feedback 442 | id 443 | 444 | 445 | logOut 446 | id 447 | 448 | 449 | 450 | icon 451 | UIImageView 452 | 453 | 454 | icon 455 | 456 | icon 457 | UIImageView 458 | 459 | 460 | 461 | IBProjectSource 462 | ./Classes/CISettingsViewController.h 463 | 464 | 465 | 466 | 467 | 0 468 | IBCocoaTouchFramework 469 | YES 470 | 3 471 | 472 | {64, 30} 473 | {57, 57} 474 | {114, 84} 475 | 476 | 933 477 | 478 | 479 | -------------------------------------------------------------------------------- /Checkie.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 594AD8F414D4FCDD00022BEC /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 594AD8F314D4FCDD00022BEC /* UIKit.framework */; }; 11 | 594AD8F614D4FCDD00022BEC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 594AD8F514D4FCDD00022BEC /* Foundation.framework */; }; 12 | 594AD8F814D4FCDD00022BEC /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 594AD8F714D4FCDD00022BEC /* CoreGraphics.framework */; }; 13 | 594AD8FE14D4FCDD00022BEC /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 594AD8FC14D4FCDD00022BEC /* InfoPlist.strings */; }; 14 | 594AD90014D4FCDD00022BEC /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 594AD8FF14D4FCDD00022BEC /* main.m */; }; 15 | 594AD90414D4FCDD00022BEC /* CIAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 594AD90314D4FCDD00022BEC /* CIAppDelegate.m */; }; 16 | 594AD90C14D4FCFA00022BEC /* CITableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 594AD90B14D4FCFA00022BEC /* CITableViewController.m */; }; 17 | 594AD90F14D4FEC600022BEC /* CIVenuesTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 594AD90E14D4FEC600022BEC /* CIVenuesTableViewController.m */; }; 18 | 594AD91214D501B200022BEC /* CIVenue.m in Sources */ = {isa = PBXBuildFile; fileRef = 594AD91114D501B200022BEC /* CIVenue.m */; }; 19 | 594AD91514D5031800022BEC /* CIVenueCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 594AD91414D5031800022BEC /* CIVenueCell.m */; }; 20 | 594AD91814D5032E00022BEC /* CICheckInCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 594AD91714D5032E00022BEC /* CICheckInCell.m */; }; 21 | 594AD91B14D50CBA00022BEC /* CIFoursquareEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 594AD91A14D50CBA00022BEC /* CIFoursquareEngine.m */; }; 22 | 594AD91D14D50F3200022BEC /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 594AD91C14D50F3200022BEC /* CoreLocation.framework */; }; 23 | 594AD92414D5103F00022BEC /* JSONKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 594AD92114D5103F00022BEC /* JSONKit.m */; }; 24 | 594AD92D14D52AB200022BEC /* check@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 594AD92714D52AB200022BEC /* check@2x.png */; }; 25 | 594AD92F14D52AB200022BEC /* x@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 594AD92914D52AB200022BEC /* x@2x.png */; }; 26 | 594AD93014D52AB200022BEC /* x.png in Resources */ = {isa = PBXBuildFile; fileRef = 594AD92A14D52AB200022BEC /* x.png */; }; 27 | 594AD93114D52AB200022BEC /* check.png in Resources */ = {isa = PBXBuildFile; fileRef = 594AD92B14D52AB200022BEC /* check.png */; }; 28 | 594AD93514D52C8D00022BEC /* bubbleArrow@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 594AD93314D52C8D00022BEC /* bubbleArrow@2x.png */; }; 29 | 594AD93614D52C8D00022BEC /* bubbleArrow.png in Resources */ = {isa = PBXBuildFile; fileRef = 594AD93414D52C8D00022BEC /* bubbleArrow.png */; }; 30 | 594AD93914D5339000022BEC /* search.png in Resources */ = {isa = PBXBuildFile; fileRef = 594AD93714D5339000022BEC /* search.png */; }; 31 | 594AD93A14D5339000022BEC /* search@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 594AD93814D5339000022BEC /* search@2x.png */; }; 32 | 594AD94414D5400F00022BEC /* CILogInViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 594AD94014D5400E00022BEC /* CILogInViewController.m */; }; 33 | 594AD94514D5400F00022BEC /* CILogInViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 594AD94114D5400E00022BEC /* CILogInViewController.xib */; }; 34 | 594AD95814D5403500022BEC /* back.png in Resources */ = {isa = PBXBuildFile; fileRef = 594AD94914D5403500022BEC /* back.png */; }; 35 | 594AD95914D5403500022BEC /* back@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 594AD94A14D5403500022BEC /* back@2x.png */; }; 36 | 594AD95A14D5403500022BEC /* backWhite.png in Resources */ = {isa = PBXBuildFile; fileRef = 594AD94B14D5403500022BEC /* backWhite.png */; }; 37 | 594AD95B14D5403500022BEC /* backWhite@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 594AD94C14D5403500022BEC /* backWhite@2x.png */; }; 38 | 594AD95C14D5403500022BEC /* TJBackButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 594AD94E14D5403500022BEC /* TJBackButton.m */; }; 39 | 594AD95D14D5403500022BEC /* TJPageControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 594AD95014D5403500022BEC /* TJPageControl.m */; }; 40 | 594AD95E14D5403500022BEC /* TJScrollViewExtenderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 594AD95214D5403500022BEC /* TJScrollViewExtenderView.m */; }; 41 | 594AD95F14D5403500022BEC /* TJSwitch.m in Sources */ = {isa = PBXBuildFile; fileRef = 594AD95414D5403500022BEC /* TJSwitch.m */; }; 42 | 594AD96014D5403500022BEC /* UIViewController+Loading.m in Sources */ = {isa = PBXBuildFile; fileRef = 594AD95714D5403500022BEC /* UIViewController+Loading.m */; }; 43 | 594AD9A214D5526B00022BEC /* UITableView + PullToRefresh.m in Sources */ = {isa = PBXBuildFile; fileRef = 594AD9A114D5526B00022BEC /* UITableView + PullToRefresh.m */; }; 44 | 594AD9DC14D5531C00022BEC /* pullToRefresh.png in Resources */ = {isa = PBXBuildFile; fileRef = 594AD9DA14D5531C00022BEC /* pullToRefresh.png */; }; 45 | 594AD9DD14D5531C00022BEC /* pullToRefresh@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 594AD9DB14D5531C00022BEC /* pullToRefresh@2x.png */; }; 46 | 594ADA5214D5609400022BEC /* settings.png in Resources */ = {isa = PBXBuildFile; fileRef = 594ADA5014D5609400022BEC /* settings.png */; }; 47 | 594ADA5314D5609400022BEC /* settings@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 594ADA5114D5609400022BEC /* settings@2x.png */; }; 48 | 596A2DDE14DA605000DB7FC4 /* CIAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = 596A2DDD14DA605000DB7FC4 /* CIAlertView.m */; }; 49 | 599C82AC1501E3B7005AA747 /* CIVenueViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 599C82AA1501E3B7005AA747 /* CIVenueViewController.m */; }; 50 | 59ACD41714D6557300039CB9 /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 59ACD41614D6557300039CB9 /* icon.png */; }; 51 | 59ACD41914D6557800039CB9 /* icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 59ACD41814D6557800039CB9 /* icon@2x.png */; }; 52 | 59D90E7C14D5F99400ACC7C0 /* CISettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 59D90E7A14D5F99400ACC7C0 /* CISettingsViewController.m */; }; 53 | 59D90E7D14D5F99400ACC7C0 /* CISettingsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 59D90E7B14D5F99400ACC7C0 /* CISettingsViewController.xib */; }; 54 | 59D90E8E14D62B0200ACC7C0 /* MessageUI + TJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 59D90E8C14D62B0200ACC7C0 /* MessageUI + TJAdditions.m */; }; 55 | 59D90E9214D62B3600ACC7C0 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59D90E9114D62B3600ACC7C0 /* MessageUI.framework */; }; 56 | 59D90E9C14D62E7D00ACC7C0 /* logo.png in Resources */ = {isa = PBXBuildFile; fileRef = 59D90E9B14D62E7D00ACC7C0 /* logo.png */; }; 57 | 59D90E9F14D6300A00ACC7C0 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59D90E9E14D6300A00ACC7C0 /* QuartzCore.framework */; }; 58 | 59D90EA314D64C8400ACC7C0 /* libFlurryAnalytics.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 59D90EA214D64C8400ACC7C0 /* libFlurryAnalytics.a */; }; 59 | /* End PBXBuildFile section */ 60 | 61 | /* Begin PBXFileReference section */ 62 | 594AD8EF14D4FCDD00022BEC /* Checkie.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Checkie.app; sourceTree = BUILT_PRODUCTS_DIR; }; 63 | 594AD8F314D4FCDD00022BEC /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 64 | 594AD8F514D4FCDD00022BEC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 65 | 594AD8F714D4FCDD00022BEC /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 66 | 594AD8FB14D4FCDD00022BEC /* Checkie-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Checkie-Info.plist"; sourceTree = ""; }; 67 | 594AD8FD14D4FCDD00022BEC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 68 | 594AD8FF14D4FCDD00022BEC /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 69 | 594AD90114D4FCDD00022BEC /* Checkie-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Checkie-Prefix.pch"; sourceTree = ""; }; 70 | 594AD90214D4FCDD00022BEC /* CIAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CIAppDelegate.h; sourceTree = ""; }; 71 | 594AD90314D4FCDD00022BEC /* CIAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CIAppDelegate.m; sourceTree = ""; }; 72 | 594AD90A14D4FCFA00022BEC /* CITableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CITableViewController.h; sourceTree = ""; }; 73 | 594AD90B14D4FCFA00022BEC /* CITableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CITableViewController.m; sourceTree = ""; }; 74 | 594AD90D14D4FEC600022BEC /* CIVenuesTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CIVenuesTableViewController.h; sourceTree = ""; }; 75 | 594AD90E14D4FEC600022BEC /* CIVenuesTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CIVenuesTableViewController.m; sourceTree = ""; }; 76 | 594AD91014D501B200022BEC /* CIVenue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CIVenue.h; sourceTree = ""; }; 77 | 594AD91114D501B200022BEC /* CIVenue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CIVenue.m; sourceTree = ""; }; 78 | 594AD91314D5031800022BEC /* CIVenueCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CIVenueCell.h; sourceTree = ""; }; 79 | 594AD91414D5031800022BEC /* CIVenueCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CIVenueCell.m; sourceTree = ""; }; 80 | 594AD91614D5032E00022BEC /* CICheckInCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CICheckInCell.h; sourceTree = ""; }; 81 | 594AD91714D5032E00022BEC /* CICheckInCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CICheckInCell.m; sourceTree = ""; }; 82 | 594AD91914D50CBA00022BEC /* CIFoursquareEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CIFoursquareEngine.h; sourceTree = ""; }; 83 | 594AD91A14D50CBA00022BEC /* CIFoursquareEngine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CIFoursquareEngine.m; sourceTree = ""; }; 84 | 594AD91C14D50F3200022BEC /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; 85 | 594AD92014D5103F00022BEC /* JSONKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONKit.h; sourceTree = ""; }; 86 | 594AD92114D5103F00022BEC /* JSONKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSONKit.m; sourceTree = ""; }; 87 | 594AD92714D52AB200022BEC /* check@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "check@2x.png"; sourceTree = ""; }; 88 | 594AD92914D52AB200022BEC /* x@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "x@2x.png"; sourceTree = ""; }; 89 | 594AD92A14D52AB200022BEC /* x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = x.png; sourceTree = ""; }; 90 | 594AD92B14D52AB200022BEC /* check.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = check.png; sourceTree = ""; }; 91 | 594AD93314D52C8D00022BEC /* bubbleArrow@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "bubbleArrow@2x.png"; sourceTree = ""; }; 92 | 594AD93414D52C8D00022BEC /* bubbleArrow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bubbleArrow.png; sourceTree = ""; }; 93 | 594AD93714D5339000022BEC /* search.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = search.png; sourceTree = ""; }; 94 | 594AD93814D5339000022BEC /* search@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "search@2x.png"; sourceTree = ""; }; 95 | 594AD93F14D5400E00022BEC /* CILogInViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CILogInViewController.h; sourceTree = ""; }; 96 | 594AD94014D5400E00022BEC /* CILogInViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CILogInViewController.m; sourceTree = ""; }; 97 | 594AD94114D5400E00022BEC /* CILogInViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CILogInViewController.xib; sourceTree = ""; }; 98 | 594AD94914D5403500022BEC /* back.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = back.png; sourceTree = ""; }; 99 | 594AD94A14D5403500022BEC /* back@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "back@2x.png"; sourceTree = ""; }; 100 | 594AD94B14D5403500022BEC /* backWhite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = backWhite.png; sourceTree = ""; }; 101 | 594AD94C14D5403500022BEC /* backWhite@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "backWhite@2x.png"; sourceTree = ""; }; 102 | 594AD94D14D5403500022BEC /* TJBackButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TJBackButton.h; sourceTree = ""; }; 103 | 594AD94E14D5403500022BEC /* TJBackButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TJBackButton.m; sourceTree = ""; }; 104 | 594AD94F14D5403500022BEC /* TJPageControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TJPageControl.h; sourceTree = ""; }; 105 | 594AD95014D5403500022BEC /* TJPageControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TJPageControl.m; sourceTree = ""; }; 106 | 594AD95114D5403500022BEC /* TJScrollViewExtenderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TJScrollViewExtenderView.h; sourceTree = ""; }; 107 | 594AD95214D5403500022BEC /* TJScrollViewExtenderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TJScrollViewExtenderView.m; sourceTree = ""; }; 108 | 594AD95314D5403500022BEC /* TJSwitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TJSwitch.h; sourceTree = ""; }; 109 | 594AD95414D5403500022BEC /* TJSwitch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TJSwitch.m; sourceTree = ""; }; 110 | 594AD95514D5403500022BEC /* TJTinting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TJTinting.h; sourceTree = ""; }; 111 | 594AD95614D5403500022BEC /* UIViewController+Loading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+Loading.h"; sourceTree = ""; }; 112 | 594AD95714D5403500022BEC /* UIViewController+Loading.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+Loading.m"; sourceTree = ""; }; 113 | 594AD9A014D5526B00022BEC /* UITableView + PullToRefresh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITableView + PullToRefresh.h"; sourceTree = ""; }; 114 | 594AD9A114D5526B00022BEC /* UITableView + PullToRefresh.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITableView + PullToRefresh.m"; sourceTree = ""; }; 115 | 594AD9DA14D5531C00022BEC /* pullToRefresh.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pullToRefresh.png; sourceTree = ""; }; 116 | 594AD9DB14D5531C00022BEC /* pullToRefresh@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pullToRefresh@2x.png"; sourceTree = ""; }; 117 | 594ADA5014D5609400022BEC /* settings.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = settings.png; sourceTree = ""; }; 118 | 594ADA5114D5609400022BEC /* settings@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "settings@2x.png"; sourceTree = ""; }; 119 | 596A2DDC14DA605000DB7FC4 /* CIAlertView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CIAlertView.h; sourceTree = ""; }; 120 | 596A2DDD14DA605000DB7FC4 /* CIAlertView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CIAlertView.m; sourceTree = ""; }; 121 | 599C82A91501E3B7005AA747 /* CIVenueViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CIVenueViewController.h; sourceTree = ""; }; 122 | 599C82AA1501E3B7005AA747 /* CIVenueViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CIVenueViewController.m; sourceTree = ""; }; 123 | 59ACD41614D6557300039CB9 /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = icon.png; path = ../icon.png; sourceTree = ""; }; 124 | 59ACD41814D6557800039CB9 /* icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icon@2x.png"; path = "../icon@2x.png"; sourceTree = ""; }; 125 | 59D90E7914D5F99400ACC7C0 /* CISettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CISettingsViewController.h; sourceTree = ""; }; 126 | 59D90E7A14D5F99400ACC7C0 /* CISettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CISettingsViewController.m; sourceTree = ""; }; 127 | 59D90E7B14D5F99400ACC7C0 /* CISettingsViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CISettingsViewController.xib; sourceTree = ""; }; 128 | 59D90E8B14D62B0200ACC7C0 /* MessageUI + TJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MessageUI + TJAdditions.h"; sourceTree = ""; }; 129 | 59D90E8C14D62B0200ACC7C0 /* MessageUI + TJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MessageUI + TJAdditions.m"; sourceTree = ""; }; 130 | 59D90E9114D62B3600ACC7C0 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; 131 | 59D90E9B14D62E7D00ACC7C0 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; 132 | 59D90E9E14D6300A00ACC7C0 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 133 | 59D90EA114D64C8400ACC7C0 /* FlurryAnalytics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlurryAnalytics.h; sourceTree = ""; }; 134 | 59D90EA214D64C8400ACC7C0 /* libFlurryAnalytics.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libFlurryAnalytics.a; sourceTree = ""; }; 135 | /* End PBXFileReference section */ 136 | 137 | /* Begin PBXFrameworksBuildPhase section */ 138 | 594AD8EC14D4FCDD00022BEC /* Frameworks */ = { 139 | isa = PBXFrameworksBuildPhase; 140 | buildActionMask = 2147483647; 141 | files = ( 142 | 59D90E9F14D6300A00ACC7C0 /* QuartzCore.framework in Frameworks */, 143 | 59D90E9214D62B3600ACC7C0 /* MessageUI.framework in Frameworks */, 144 | 594AD91D14D50F3200022BEC /* CoreLocation.framework in Frameworks */, 145 | 594AD8F414D4FCDD00022BEC /* UIKit.framework in Frameworks */, 146 | 594AD8F614D4FCDD00022BEC /* Foundation.framework in Frameworks */, 147 | 594AD8F814D4FCDD00022BEC /* CoreGraphics.framework in Frameworks */, 148 | 59D90EA314D64C8400ACC7C0 /* libFlurryAnalytics.a in Frameworks */, 149 | ); 150 | runOnlyForDeploymentPostprocessing = 0; 151 | }; 152 | /* End PBXFrameworksBuildPhase section */ 153 | 154 | /* Begin PBXGroup section */ 155 | 594AD8E414D4FCDD00022BEC = { 156 | isa = PBXGroup; 157 | children = ( 158 | 594AD8F914D4FCDD00022BEC /* Checkie */, 159 | 594AD8F214D4FCDD00022BEC /* Frameworks */, 160 | 594AD8F014D4FCDD00022BEC /* Products */, 161 | ); 162 | sourceTree = ""; 163 | }; 164 | 594AD8F014D4FCDD00022BEC /* Products */ = { 165 | isa = PBXGroup; 166 | children = ( 167 | 594AD8EF14D4FCDD00022BEC /* Checkie.app */, 168 | ); 169 | name = Products; 170 | sourceTree = ""; 171 | }; 172 | 594AD8F214D4FCDD00022BEC /* Frameworks */ = { 173 | isa = PBXGroup; 174 | children = ( 175 | 59D90E9E14D6300A00ACC7C0 /* QuartzCore.framework */, 176 | 59D90E9114D62B3600ACC7C0 /* MessageUI.framework */, 177 | 594AD8F314D4FCDD00022BEC /* UIKit.framework */, 178 | 594AD8F514D4FCDD00022BEC /* Foundation.framework */, 179 | 594AD8F714D4FCDD00022BEC /* CoreGraphics.framework */, 180 | 594AD91C14D50F3200022BEC /* CoreLocation.framework */, 181 | ); 182 | name = Frameworks; 183 | sourceTree = ""; 184 | }; 185 | 594AD8F914D4FCDD00022BEC /* Checkie */ = { 186 | isa = PBXGroup; 187 | children = ( 188 | 594AD96514D5510900022BEC /* App Delegate */, 189 | 594AD96614D5511700022BEC /* View Controllers */, 190 | 594AD96714D5512C00022BEC /* Views */, 191 | 594AD96814D5513700022BEC /* Model */, 192 | 594AD94714D5403400022BEC /* Chromeless */, 193 | 594AD91E14D5103F00022BEC /* JSONKit */, 194 | 59D90E8A14D62B0200ACC7C0 /* MessageUIAdditions */, 195 | 59D90EA014D64C8300ACC7C0 /* FlurryAnalytics */, 196 | 594AD8FA14D4FCDD00022BEC /* Supporting Files */, 197 | 594AD92614D52AA400022BEC /* Images */, 198 | ); 199 | path = Checkie; 200 | sourceTree = ""; 201 | }; 202 | 594AD8FA14D4FCDD00022BEC /* Supporting Files */ = { 203 | isa = PBXGroup; 204 | children = ( 205 | 594AD8FB14D4FCDD00022BEC /* Checkie-Info.plist */, 206 | 594AD8FC14D4FCDD00022BEC /* InfoPlist.strings */, 207 | 594AD8FF14D4FCDD00022BEC /* main.m */, 208 | 594AD90114D4FCDD00022BEC /* Checkie-Prefix.pch */, 209 | ); 210 | name = "Supporting Files"; 211 | sourceTree = ""; 212 | }; 213 | 594AD91E14D5103F00022BEC /* JSONKit */ = { 214 | isa = PBXGroup; 215 | children = ( 216 | 594AD92014D5103F00022BEC /* JSONKit.h */, 217 | 594AD92114D5103F00022BEC /* JSONKit.m */, 218 | ); 219 | name = JSONKit; 220 | path = Vendor/JSONKit; 221 | sourceTree = SOURCE_ROOT; 222 | }; 223 | 594AD92614D52AA400022BEC /* Images */ = { 224 | isa = PBXGroup; 225 | children = ( 226 | 59ACD41814D6557800039CB9 /* icon@2x.png */, 227 | 59ACD41614D6557300039CB9 /* icon.png */, 228 | 59D90E9B14D62E7D00ACC7C0 /* logo.png */, 229 | 594AD9DA14D5531C00022BEC /* pullToRefresh.png */, 230 | 594AD9DB14D5531C00022BEC /* pullToRefresh@2x.png */, 231 | 594AD92B14D52AB200022BEC /* check.png */, 232 | 594AD92714D52AB200022BEC /* check@2x.png */, 233 | 594AD92A14D52AB200022BEC /* x.png */, 234 | 594AD92914D52AB200022BEC /* x@2x.png */, 235 | 594AD93314D52C8D00022BEC /* bubbleArrow@2x.png */, 236 | 594AD93414D52C8D00022BEC /* bubbleArrow.png */, 237 | 594AD93714D5339000022BEC /* search.png */, 238 | 594AD93814D5339000022BEC /* search@2x.png */, 239 | 594ADA5014D5609400022BEC /* settings.png */, 240 | 594ADA5114D5609400022BEC /* settings@2x.png */, 241 | ); 242 | name = Images; 243 | sourceTree = ""; 244 | }; 245 | 594AD94714D5403400022BEC /* Chromeless */ = { 246 | isa = PBXGroup; 247 | children = ( 248 | 594AD9A014D5526B00022BEC /* UITableView + PullToRefresh.h */, 249 | 594AD9A114D5526B00022BEC /* UITableView + PullToRefresh.m */, 250 | 594AD94814D5403500022BEC /* Images */, 251 | 594AD94D14D5403500022BEC /* TJBackButton.h */, 252 | 594AD94E14D5403500022BEC /* TJBackButton.m */, 253 | 594AD94F14D5403500022BEC /* TJPageControl.h */, 254 | 594AD95014D5403500022BEC /* TJPageControl.m */, 255 | 594AD95114D5403500022BEC /* TJScrollViewExtenderView.h */, 256 | 594AD95214D5403500022BEC /* TJScrollViewExtenderView.m */, 257 | 594AD95314D5403500022BEC /* TJSwitch.h */, 258 | 594AD95414D5403500022BEC /* TJSwitch.m */, 259 | 594AD95514D5403500022BEC /* TJTinting.h */, 260 | 594AD95614D5403500022BEC /* UIViewController+Loading.h */, 261 | 594AD95714D5403500022BEC /* UIViewController+Loading.m */, 262 | ); 263 | path = Chromeless; 264 | sourceTree = ""; 265 | }; 266 | 594AD94814D5403500022BEC /* Images */ = { 267 | isa = PBXGroup; 268 | children = ( 269 | 594AD94914D5403500022BEC /* back.png */, 270 | 594AD94A14D5403500022BEC /* back@2x.png */, 271 | 594AD94B14D5403500022BEC /* backWhite.png */, 272 | 594AD94C14D5403500022BEC /* backWhite@2x.png */, 273 | ); 274 | path = Images; 275 | sourceTree = ""; 276 | }; 277 | 594AD96514D5510900022BEC /* App Delegate */ = { 278 | isa = PBXGroup; 279 | children = ( 280 | 594AD90214D4FCDD00022BEC /* CIAppDelegate.h */, 281 | 594AD90314D4FCDD00022BEC /* CIAppDelegate.m */, 282 | ); 283 | name = "App Delegate"; 284 | sourceTree = ""; 285 | }; 286 | 594AD96614D5511700022BEC /* View Controllers */ = { 287 | isa = PBXGroup; 288 | children = ( 289 | 594AD90A14D4FCFA00022BEC /* CITableViewController.h */, 290 | 594AD90B14D4FCFA00022BEC /* CITableViewController.m */, 291 | 594AD90D14D4FEC600022BEC /* CIVenuesTableViewController.h */, 292 | 594AD90E14D4FEC600022BEC /* CIVenuesTableViewController.m */, 293 | 599C82A91501E3B7005AA747 /* CIVenueViewController.h */, 294 | 599C82AA1501E3B7005AA747 /* CIVenueViewController.m */, 295 | 594AD93F14D5400E00022BEC /* CILogInViewController.h */, 296 | 594AD94014D5400E00022BEC /* CILogInViewController.m */, 297 | 594AD94114D5400E00022BEC /* CILogInViewController.xib */, 298 | 59D90E7914D5F99400ACC7C0 /* CISettingsViewController.h */, 299 | 59D90E7A14D5F99400ACC7C0 /* CISettingsViewController.m */, 300 | 59D90E7B14D5F99400ACC7C0 /* CISettingsViewController.xib */, 301 | ); 302 | name = "View Controllers"; 303 | sourceTree = ""; 304 | }; 305 | 594AD96714D5512C00022BEC /* Views */ = { 306 | isa = PBXGroup; 307 | children = ( 308 | 594AD91314D5031800022BEC /* CIVenueCell.h */, 309 | 594AD91414D5031800022BEC /* CIVenueCell.m */, 310 | 594AD91614D5032E00022BEC /* CICheckInCell.h */, 311 | 594AD91714D5032E00022BEC /* CICheckInCell.m */, 312 | 596A2DDC14DA605000DB7FC4 /* CIAlertView.h */, 313 | 596A2DDD14DA605000DB7FC4 /* CIAlertView.m */, 314 | ); 315 | name = Views; 316 | sourceTree = ""; 317 | }; 318 | 594AD96814D5513700022BEC /* Model */ = { 319 | isa = PBXGroup; 320 | children = ( 321 | 594AD91014D501B200022BEC /* CIVenue.h */, 322 | 594AD91114D501B200022BEC /* CIVenue.m */, 323 | 594AD91914D50CBA00022BEC /* CIFoursquareEngine.h */, 324 | 594AD91A14D50CBA00022BEC /* CIFoursquareEngine.m */, 325 | ); 326 | name = Model; 327 | sourceTree = ""; 328 | }; 329 | 59D90E8A14D62B0200ACC7C0 /* MessageUIAdditions */ = { 330 | isa = PBXGroup; 331 | children = ( 332 | 59D90E8B14D62B0200ACC7C0 /* MessageUI + TJAdditions.h */, 333 | 59D90E8C14D62B0200ACC7C0 /* MessageUI + TJAdditions.m */, 334 | ); 335 | name = MessageUIAdditions; 336 | path = Vendor/MessageUIAdditions; 337 | sourceTree = SOURCE_ROOT; 338 | }; 339 | 59D90EA014D64C8300ACC7C0 /* FlurryAnalytics */ = { 340 | isa = PBXGroup; 341 | children = ( 342 | 59D90EA114D64C8400ACC7C0 /* FlurryAnalytics.h */, 343 | 59D90EA214D64C8400ACC7C0 /* libFlurryAnalytics.a */, 344 | ); 345 | path = FlurryAnalytics; 346 | sourceTree = ""; 347 | }; 348 | /* End PBXGroup section */ 349 | 350 | /* Begin PBXNativeTarget section */ 351 | 594AD8EE14D4FCDD00022BEC /* Checkie */ = { 352 | isa = PBXNativeTarget; 353 | buildConfigurationList = 594AD90714D4FCDD00022BEC /* Build configuration list for PBXNativeTarget "Checkie" */; 354 | buildPhases = ( 355 | 594AD8EB14D4FCDD00022BEC /* Sources */, 356 | 594AD8EC14D4FCDD00022BEC /* Frameworks */, 357 | 594AD8ED14D4FCDD00022BEC /* Resources */, 358 | ); 359 | buildRules = ( 360 | ); 361 | dependencies = ( 362 | ); 363 | name = Checkie; 364 | productName = Checkie; 365 | productReference = 594AD8EF14D4FCDD00022BEC /* Checkie.app */; 366 | productType = "com.apple.product-type.application"; 367 | }; 368 | /* End PBXNativeTarget section */ 369 | 370 | /* Begin PBXProject section */ 371 | 594AD8E614D4FCDD00022BEC /* Project object */ = { 372 | isa = PBXProject; 373 | attributes = { 374 | LastUpgradeCheck = 0420; 375 | }; 376 | buildConfigurationList = 594AD8E914D4FCDD00022BEC /* Build configuration list for PBXProject "Checkie" */; 377 | compatibilityVersion = "Xcode 3.2"; 378 | developmentRegion = English; 379 | hasScannedForEncodings = 0; 380 | knownRegions = ( 381 | en, 382 | ); 383 | mainGroup = 594AD8E414D4FCDD00022BEC; 384 | productRefGroup = 594AD8F014D4FCDD00022BEC /* Products */; 385 | projectDirPath = ""; 386 | projectRoot = ""; 387 | targets = ( 388 | 594AD8EE14D4FCDD00022BEC /* Checkie */, 389 | ); 390 | }; 391 | /* End PBXProject section */ 392 | 393 | /* Begin PBXResourcesBuildPhase section */ 394 | 594AD8ED14D4FCDD00022BEC /* Resources */ = { 395 | isa = PBXResourcesBuildPhase; 396 | buildActionMask = 2147483647; 397 | files = ( 398 | 594AD8FE14D4FCDD00022BEC /* InfoPlist.strings in Resources */, 399 | 594AD92D14D52AB200022BEC /* check@2x.png in Resources */, 400 | 594AD92F14D52AB200022BEC /* x@2x.png in Resources */, 401 | 594AD93014D52AB200022BEC /* x.png in Resources */, 402 | 594AD93114D52AB200022BEC /* check.png in Resources */, 403 | 594AD93514D52C8D00022BEC /* bubbleArrow@2x.png in Resources */, 404 | 594AD93614D52C8D00022BEC /* bubbleArrow.png in Resources */, 405 | 594AD93914D5339000022BEC /* search.png in Resources */, 406 | 594AD93A14D5339000022BEC /* search@2x.png in Resources */, 407 | 594AD94514D5400F00022BEC /* CILogInViewController.xib in Resources */, 408 | 594AD95814D5403500022BEC /* back.png in Resources */, 409 | 594AD95914D5403500022BEC /* back@2x.png in Resources */, 410 | 594AD95A14D5403500022BEC /* backWhite.png in Resources */, 411 | 594AD95B14D5403500022BEC /* backWhite@2x.png in Resources */, 412 | 594AD9DC14D5531C00022BEC /* pullToRefresh.png in Resources */, 413 | 594AD9DD14D5531C00022BEC /* pullToRefresh@2x.png in Resources */, 414 | 594ADA5214D5609400022BEC /* settings.png in Resources */, 415 | 594ADA5314D5609400022BEC /* settings@2x.png in Resources */, 416 | 59D90E7D14D5F99400ACC7C0 /* CISettingsViewController.xib in Resources */, 417 | 59D90E9C14D62E7D00ACC7C0 /* logo.png in Resources */, 418 | 59ACD41714D6557300039CB9 /* icon.png in Resources */, 419 | 59ACD41914D6557800039CB9 /* icon@2x.png in Resources */, 420 | ); 421 | runOnlyForDeploymentPostprocessing = 0; 422 | }; 423 | /* End PBXResourcesBuildPhase section */ 424 | 425 | /* Begin PBXSourcesBuildPhase section */ 426 | 594AD8EB14D4FCDD00022BEC /* Sources */ = { 427 | isa = PBXSourcesBuildPhase; 428 | buildActionMask = 2147483647; 429 | files = ( 430 | 594AD90014D4FCDD00022BEC /* main.m in Sources */, 431 | 594AD90414D4FCDD00022BEC /* CIAppDelegate.m in Sources */, 432 | 594AD90C14D4FCFA00022BEC /* CITableViewController.m in Sources */, 433 | 594AD90F14D4FEC600022BEC /* CIVenuesTableViewController.m in Sources */, 434 | 594AD91214D501B200022BEC /* CIVenue.m in Sources */, 435 | 594AD91514D5031800022BEC /* CIVenueCell.m in Sources */, 436 | 594AD91814D5032E00022BEC /* CICheckInCell.m in Sources */, 437 | 594AD91B14D50CBA00022BEC /* CIFoursquareEngine.m in Sources */, 438 | 594AD92414D5103F00022BEC /* JSONKit.m in Sources */, 439 | 594AD94414D5400F00022BEC /* CILogInViewController.m in Sources */, 440 | 594AD95C14D5403500022BEC /* TJBackButton.m in Sources */, 441 | 594AD95D14D5403500022BEC /* TJPageControl.m in Sources */, 442 | 594AD95E14D5403500022BEC /* TJScrollViewExtenderView.m in Sources */, 443 | 594AD95F14D5403500022BEC /* TJSwitch.m in Sources */, 444 | 594AD96014D5403500022BEC /* UIViewController+Loading.m in Sources */, 445 | 594AD9A214D5526B00022BEC /* UITableView + PullToRefresh.m in Sources */, 446 | 59D90E7C14D5F99400ACC7C0 /* CISettingsViewController.m in Sources */, 447 | 59D90E8E14D62B0200ACC7C0 /* MessageUI + TJAdditions.m in Sources */, 448 | 596A2DDE14DA605000DB7FC4 /* CIAlertView.m in Sources */, 449 | 599C82AC1501E3B7005AA747 /* CIVenueViewController.m in Sources */, 450 | ); 451 | runOnlyForDeploymentPostprocessing = 0; 452 | }; 453 | /* End PBXSourcesBuildPhase section */ 454 | 455 | /* Begin PBXVariantGroup section */ 456 | 594AD8FC14D4FCDD00022BEC /* InfoPlist.strings */ = { 457 | isa = PBXVariantGroup; 458 | children = ( 459 | 594AD8FD14D4FCDD00022BEC /* en */, 460 | ); 461 | name = InfoPlist.strings; 462 | sourceTree = ""; 463 | }; 464 | /* End PBXVariantGroup section */ 465 | 466 | /* Begin XCBuildConfiguration section */ 467 | 594AD90514D4FCDD00022BEC /* Debug */ = { 468 | isa = XCBuildConfiguration; 469 | buildSettings = { 470 | ALWAYS_SEARCH_USER_PATHS = NO; 471 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 472 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 473 | COPY_PHASE_STRIP = NO; 474 | GCC_C_LANGUAGE_STANDARD = gnu99; 475 | GCC_DYNAMIC_NO_PIC = NO; 476 | GCC_OPTIMIZATION_LEVEL = 0; 477 | GCC_PREPROCESSOR_DEFINITIONS = ( 478 | "DEBUG=1", 479 | "$(inherited)", 480 | ); 481 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 482 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 483 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 484 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 485 | GCC_WARN_UNUSED_VARIABLE = YES; 486 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 487 | SDKROOT = iphoneos; 488 | }; 489 | name = Debug; 490 | }; 491 | 594AD90614D4FCDD00022BEC /* Release */ = { 492 | isa = XCBuildConfiguration; 493 | buildSettings = { 494 | ALWAYS_SEARCH_USER_PATHS = NO; 495 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 496 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 497 | COPY_PHASE_STRIP = YES; 498 | GCC_C_LANGUAGE_STANDARD = gnu99; 499 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 500 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 501 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 502 | GCC_WARN_UNUSED_VARIABLE = YES; 503 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 504 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 505 | SDKROOT = iphoneos; 506 | VALIDATE_PRODUCT = YES; 507 | }; 508 | name = Release; 509 | }; 510 | 594AD90814D4FCDD00022BEC /* Debug */ = { 511 | isa = XCBuildConfiguration; 512 | buildSettings = { 513 | CODE_SIGN_IDENTITY = "iPhone Developer: Timothy Johnsen (53XC84URUL)"; 514 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Timothy Johnsen (53XC84URUL)"; 515 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 516 | GCC_PREFIX_HEADER = "Checkie/Checkie-Prefix.pch"; 517 | INFOPLIST_FILE = "Checkie/Checkie-Info.plist"; 518 | LIBRARY_SEARCH_PATHS = ( 519 | "$(inherited)", 520 | "\"$(SRCROOT)/Checkie/FlurryAnalytics\"", 521 | ); 522 | PRODUCT_NAME = "$(TARGET_NAME)"; 523 | PROVISIONING_PROFILE = "59FB17F4-986C-478D-810A-922D923F5F50"; 524 | "PROVISIONING_PROFILE[sdk=iphoneos*]" = "59FB17F4-986C-478D-810A-922D923F5F50"; 525 | WRAPPER_EXTENSION = app; 526 | }; 527 | name = Debug; 528 | }; 529 | 594AD90914D4FCDD00022BEC /* Release */ = { 530 | isa = XCBuildConfiguration; 531 | buildSettings = { 532 | CODE_SIGN_IDENTITY = "iPhone Distribution: Timothy Johnsen"; 533 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Timothy Johnsen"; 534 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 535 | GCC_PREFIX_HEADER = "Checkie/Checkie-Prefix.pch"; 536 | INFOPLIST_FILE = "Checkie/Checkie-Info.plist"; 537 | LIBRARY_SEARCH_PATHS = ( 538 | "$(inherited)", 539 | "\"$(SRCROOT)/Checkie/FlurryAnalytics\"", 540 | ); 541 | PRODUCT_NAME = "$(TARGET_NAME)"; 542 | PROVISIONING_PROFILE = "5B64F87A-CE9D-46A2-8E2B-F3A1BF20F6E6"; 543 | "PROVISIONING_PROFILE[sdk=iphoneos*]" = "5B64F87A-CE9D-46A2-8E2B-F3A1BF20F6E6"; 544 | WRAPPER_EXTENSION = app; 545 | }; 546 | name = Release; 547 | }; 548 | /* End XCBuildConfiguration section */ 549 | 550 | /* Begin XCConfigurationList section */ 551 | 594AD8E914D4FCDD00022BEC /* Build configuration list for PBXProject "Checkie" */ = { 552 | isa = XCConfigurationList; 553 | buildConfigurations = ( 554 | 594AD90514D4FCDD00022BEC /* Debug */, 555 | 594AD90614D4FCDD00022BEC /* Release */, 556 | ); 557 | defaultConfigurationIsVisible = 0; 558 | defaultConfigurationName = Release; 559 | }; 560 | 594AD90714D4FCDD00022BEC /* Build configuration list for PBXNativeTarget "Checkie" */ = { 561 | isa = XCConfigurationList; 562 | buildConfigurations = ( 563 | 594AD90814D4FCDD00022BEC /* Debug */, 564 | 594AD90914D4FCDD00022BEC /* Release */, 565 | ); 566 | defaultConfigurationIsVisible = 0; 567 | defaultConfigurationName = Release; 568 | }; 569 | /* End XCConfigurationList section */ 570 | }; 571 | rootObject = 594AD8E614D4FCDD00022BEC /* Project object */; 572 | } 573 | --------------------------------------------------------------------------------