├── Config.xcconfig ├── Source ├── NSObject+Extensions.h ├── CustomNavigationController.h ├── NSObject+Persistence.h ├── UISearchDisplayController+Custom.h ├── NSObject+Extensions.m ├── ChoicesListDataSource.h ├── UINavigationController+Custom.h ├── BaseWebViewController.h ├── UISearchDisplayController+Custom.m ├── BaseTableViewRefreshController.h ├── CustomSearchBar.h ├── NSDate+Extensions.h ├── BaseASIServices+Utils.h ├── CustomNavigationController.m ├── MyLocationGetter.h ├── BaseTableViewDataSource.h ├── NSDictionary+Persistence.h ├── AccessoryViewWithImage.h ├── BaseTableViewController.h ├── BaseViewController.h ├── BaseASIServices.h ├── UINavigationController+Custom.m ├── FacebookServices.h ├── CustomToolBar.h ├── ObjectiveDump3.h ├── TwitterServices.h ├── CustomNavigationBar.h ├── BaseLoadingViewCenter.h ├── ChoicesListDataSource.m ├── NSObject+Persistence.m ├── BaseASIServices+Utils.m ├── MyLocationGetter.m ├── NSDictionary+Persistence.m ├── NSDate+Extensions.m ├── BaseTableViewDataSource.m ├── BaseTableViewRefreshController.m ├── FacebookServices.m ├── BaseLoadingViewCenter.m ├── AccessoryViewWithImage.m ├── BaseTableViewController.m ├── CustomSearchBar.m ├── CustomNavigationBar.m ├── TwitterServices.m ├── BaseASIServices.m ├── CustomToolbar.m ├── BaseWebViewController.m └── BaseViewController.m ├── .gitignore ├── README ├── KitSpec ├── Prefix.pch └── resources ├── BaseWebView.xib └── CustomNavigationController.xib /Config.xcconfig: -------------------------------------------------------------------------------- 1 | OTHER_LDFLAGS = $(OTHER_LDFLAGS) -framework CoreLocation -framework QuartzCore -------------------------------------------------------------------------------- /Source/NSObject+Extensions.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface NSObject (Extensions) 5 | 6 | - (id)niledNull; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /Source/CustomNavigationController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface CustomNavigationController : UINavigationController { 5 | 6 | } 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /Source/NSObject+Persistence.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface NSObject (Persistence) 5 | 6 | + (NSObject *)savedForKey:(NSString *)key; 7 | - (void)saveForKey:(NSString *)key; 8 | 9 | @end -------------------------------------------------------------------------------- /Source/UISearchDisplayController+Custom.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CustomSearchBar.h" 3 | 4 | @interface UISearchDisplayController(Custom) 5 | 6 | @property (nonatomic, readonly) CustomSearchBar *customSearchBar; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode noise 2 | build/** 3 | *.pbxuser 4 | *.perspectivev3 5 | *.mode1v3 6 | 7 | # Xcode 4 noise 8 | *.xcworkspace 9 | xcuserdata 10 | 11 | # old skool 12 | .svn 13 | .cvs 14 | 15 | # osx noise 16 | .DS_Store 17 | 18 | # Kit 19 | dist -------------------------------------------------------------------------------- /Source/NSObject+Extensions.m: -------------------------------------------------------------------------------- 1 | #import "NSObject+Extensions.h" 2 | 3 | 4 | @implementation NSObject (Extensions) 5 | 6 | - (id)niledNull 7 | { 8 | if ([self isKindOfClass:[NSNull class]]) { 9 | return nil; 10 | } 11 | 12 | return self; 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Right after cloning the project, don't forget to 2 | update the submodules: 3 | 4 | If you have a recent version of git, you 5 | can do this easily by executing the following command: 6 | 7 | - git submodule update --init --recursive 8 | - then make sure you close and reopen your project on Xcode. -------------------------------------------------------------------------------- /KitSpec: -------------------------------------------------------------------------------- 1 | name: ObjectiveDump3 2 | version: 1.2 3 | source-directory: Source 4 | dependencies: 5 | - asi-http-request: 1.8 6 | - facebook-ios-sdk: 1.0 7 | - PlainOAuth: 1.0 8 | - NSDate-Extensions: 1.0 9 | - Gallagher: 1.0 10 | - EGOTableViewPullRefresh: 1.0 11 | - MBProgressHUD: 1.0 12 | 13 | -------------------------------------------------------------------------------- /Source/ChoicesListDataSource.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "BaseTableViewDataSource.h" 3 | 4 | @interface ChoicesListDataSource : BaseTableViewDataSource { 5 | 6 | } 7 | 8 | - (id)initWitChoicesList:(NSArray *)choicesList; 9 | 10 | - (NSString *)choiceForIndexPath:(NSIndexPath *)indexPath; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Source/UINavigationController+Custom.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CustomNavigationBar.h" 3 | #import "CustomToolbar.h" 4 | 5 | @interface UINavigationController (Custom) 6 | 7 | @property (nonatomic, readonly) CustomNavigationBar *customNavigationBar; 8 | @property (nonatomic, readonly) CustomToolbar *customToolbar; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Source/BaseWebViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "BaseViewController.h" 3 | 4 | @interface BaseWebViewController : BaseViewController { 5 | 6 | } 7 | 8 | @property (nonatomic, retain) IBOutlet UIWebView *webView; 9 | 10 | @property (nonatomic, retain) NSURLRequest *request; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Source/UISearchDisplayController+Custom.m: -------------------------------------------------------------------------------- 1 | #import "UISearchDisplayController+Custom.h" 2 | 3 | 4 | @implementation UISearchDisplayController(Custom) 5 | 6 | - (CustomSearchBar *)customSearchBar 7 | { 8 | if (![self.searchBar isKindOfClass:[CustomSearchBar class]]) { 9 | return nil; 10 | } 11 | 12 | return (CustomSearchBar *)self.searchBar; 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Source/BaseTableViewRefreshController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "BaseTableViewController.h" 3 | #import "EGORefreshTableHeaderView.h" 4 | 5 | @interface BaseTableViewRefreshController : BaseTableViewController { 6 | 7 | } 8 | 9 | @property (nonatomic, readonly) EGORefreshTableHeaderView *refreshHeaderView; 10 | 11 | - (void)hideRefreshHeaderView; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/CustomSearchBar.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface CustomSearchBar : UISearchBar { 5 | 6 | } 7 | 8 | - (UIImage *)backgroundImageForStyle:(UIBarStyle)barStyle; 9 | - (void)setBackgroundImage:(UIImage *)backgroundImage forBarStyle:(UIBarStyle)aBarStyle; 10 | - (void)clearBackground; 11 | 12 | - (void)setupCustomInitialisation; 13 | 14 | @property(nonatomic) UIKeyboardAppearance keyboardAppearance; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Source/NSDate+Extensions.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface NSDate (Extensions) 4 | 5 | + (NSString *)stringForDisplayFromDate:(NSDate *)date; 6 | + (NSString *)stringForDisplayFromDate:(NSDate *)date prefixed:(BOOL)prefixed; 7 | + (NSString *)stringForDisplayFromDate:(NSDate *)date prefixed:(BOOL)prefixed alwaysShowTime:(BOOL)showTime; 8 | 9 | - (NSString *)getUTCDateWithformat:(NSString *)format; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /Source/BaseASIServices+Utils.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "BaseASIServices.h" 3 | 4 | @interface BaseASIServices (utils) 5 | 6 | - (NSString *)notificationNameForRequest:(ASIHTTPRequest *)request; 7 | - (void)informEmtpy:(BOOL)empty forKey:(NSString *)key; 8 | - (void)notifyDone:(ASIHTTPRequest *)request object:(id)object; 9 | - (void)notifyFailed:(ASIHTTPRequest *)request withError:(NSString *)errorString; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /Source/CustomNavigationController.m: -------------------------------------------------------------------------------- 1 | #import "CustomNavigationController.h" 2 | 3 | 4 | @implementation CustomNavigationController 5 | 6 | - (id)initWithRootViewController:(UIViewController *)rootViewController 7 | { 8 | self = [[[[NSBundle mainBundle] loadNibNamed:@"CustomNavigationController" owner:self options:nil] lastObject]retain]; 9 | if (self != nil) { 10 | [self setViewControllers:[NSArray arrayWithObject:rootViewController]]; 11 | } 12 | return self; 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Source/MyLocationGetter.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | // GPS 5 | #define GPSLocationDidFix @"GPSLocationDidFix" 6 | #define GPSLocationDidStop @"GPSLocationDidStop" 7 | #define GPSLocationFinding @"GPSLocationFinding" 8 | 9 | @interface MyLocationGetter : NSObject { 10 | } 11 | 12 | @property (nonatomic, readonly) CLLocationManager *locationManager; 13 | 14 | - (void)startUpdates; 15 | - (void)stopUpdates; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Source/BaseTableViewDataSource.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface BaseTableViewDataSource : NSObject { 5 | 6 | } 7 | 8 | @property (nonatomic, readonly) NSMutableArray *content; 9 | - (void)resetContent; 10 | 11 | - (id)objectForIndexPath:(NSIndexPath *)indexPath; 12 | 13 | @end 14 | 15 | @protocol BaseTableViewDataSource 16 | 17 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath; 18 | 19 | @end 20 | 21 | -------------------------------------------------------------------------------- /Source/NSDictionary+Persistence.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface NSDictionary (Persistence) 5 | 6 | + (NSDictionary *)dictionaryWithContent:(NSArray *)content date:(NSDate *)date; 7 | 8 | - (id)objectUnderArray:(id)object forPathToId:(NSString *)pathToId forKey:(NSString *)key; 9 | - (id)filteredObjectsUnderArray:(id)object forPath:(NSString *)path forKey:(NSString *)key; 10 | - (void)setObjectUnderArray:(id)object forPathToId:(NSString *)pathToId forKey:(NSString *)key; 11 | - (void)removeObjectUnderArray:(id)object forPathToId:(NSString *)pathToId forKey:(NSString *)key; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/AccessoryViewWithImage.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface AccessoryViewWithImage : UIView { 5 | UIImageView *_imageView; 6 | } 7 | 8 | @property (nonatomic, readonly) UIImageView *imageView; 9 | @property (nonatomic) CGFloat leftRightDiff; 10 | 11 | +(id)accessoryViewWithImageNamed:(NSString *)imageNamed highlightedImageNamed:(NSString *)highlightedImageNamed cellHeight:(CGFloat)cellHeight; 12 | +(id)accessoryViewWithImageNamed:(NSString *)imageNamed highlightedImageNamed:(NSString *)highlightedImageNamed cellHeight:(CGFloat)cellHeight leftRightDiff:(CGFloat)leftRightDiff; 13 | 14 | - (void)setupCustomInitialisation; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Source/BaseTableViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "BaseViewController.h" 3 | 4 | @interface BaseTableViewController : BaseViewController { 5 | 6 | } 7 | 8 | @property (nonatomic, retain) IBOutlet UITableView *tableView; 9 | - (void)setupDataSource; 10 | 11 | - (BOOL)isIndexPathLastRow:(NSIndexPath *)indexPath; 12 | - (BOOL)isIndexPathSingleRow:(NSIndexPath *)indexPath; 13 | 14 | // Content Filtering 15 | @property (nonatomic, retain) NSString *searchString; 16 | - (void)setupSearchDataSource; 17 | - (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Source/BaseViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "MBProgressHUD.h" 3 | #import "BaseLoadingViewCenter.h" 4 | #import "UINavigationController+Custom.h" 5 | #import "UISearchDisplayController+Custom.h" 6 | 7 | @interface BaseViewController : UIViewController { 8 | } 9 | 10 | - (void)setupCustomInitialisation; 11 | 12 | - (void)setupNavigationBar; 13 | - (void)setupToolbar; 14 | 15 | - (void)locationDidFix; 16 | - (void)locationDidStop; 17 | 18 | - (void)shouldReloadContent:(NSNotification *)notification; 19 | 20 | @property (nonatomic, retain) MBProgressHUD *loadingView; 21 | @property (nonatomic, retain) MBProgressHUD *noResultsView; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Source/BaseASIServices.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "ASINetworkQueue.h" 3 | #import "ASIHTTPRequest.h" 4 | #import "ASIFormDataRequest.h" 5 | #import "BaseLoadingViewCenter.h" 6 | 7 | 8 | #if !defined(RequestTimeOutSeconds) 9 | #define RequestTimeOutSeconds 45.0 10 | #endif 11 | 12 | @interface BaseASIServices : NSObject { 13 | 14 | } 15 | 16 | @property (nonatomic, readonly) ASINetworkQueue *networkQueue; 17 | 18 | - (void)applicationWillResignActive; 19 | 20 | - (ASIHTTPRequest *)requestWithUrl:(NSString *)url; 21 | - (ASIFormDataRequest *)formRequestWithUrl:(NSString *)url; 22 | 23 | - (void)downloadContentForUrl:(NSString *)url withObject:(id)object path:(NSString *)path notificationName:(NSString *)notificationName; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Source/UINavigationController+Custom.m: -------------------------------------------------------------------------------- 1 | #import "UINavigationController+Custom.h" 2 | 3 | 4 | @implementation UINavigationController (CustomNavigationBar) 5 | 6 | #pragma mark - 7 | #pragma mark CustomNavigationBar 8 | 9 | - (CustomNavigationBar *)customNavigationBar 10 | { 11 | if (![self.navigationBar isKindOfClass:[CustomNavigationBar class]]) { 12 | return nil; 13 | } 14 | 15 | return (CustomNavigationBar *)self.navigationBar; 16 | } 17 | 18 | - (void)customBackButtonTouched 19 | { 20 | [self popViewControllerAnimated:TRUE]; 21 | } 22 | 23 | #pragma mark - 24 | #pragma mark CustomToolbar 25 | 26 | - (CustomToolbar *)customToolbar 27 | { 28 | if (![self.toolbar isKindOfClass:[CustomToolbar class]]) { 29 | return nil; 30 | } 31 | 32 | return (CustomToolbar *)self.toolbar; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #import 4 | #import "SynthesizeSingleton.h" 5 | #import 6 | #import "NSObject+Extensions.h" 7 | #import "CustomNavigationController.h" 8 | #endif 9 | 10 | //Right-click on your target and click Get Info. Select the Build tab. Make sure Configuration is set to Debug. Add -DDEBUG to the Other C Flags of your target. 11 | // 12 | //And that’s about it. When you want to log only in debug builds use DLog(). In release builds DLog() will be compiled as an empty comment. Otherwise use ALog() for logging in both debug and release builds. (A as in always.) 13 | #ifdef DEBUG 14 | # define DLog(...) NSLog(__VA_ARGS__) 15 | #else 16 | # define DLog(...) /* */ 17 | #endif 18 | #define ALog(...) NSLog(__VA_ARGS__) -------------------------------------------------------------------------------- /Source/FacebookServices.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "FBConnect.h" 3 | 4 | #define FacebookNotification @"FacebookNotification" 5 | #define FacebookAuthorizedPermissionsUserDefaults @"FacebookAuthorizedPermissionsUserDefaults" 6 | 7 | @interface FacebookServices : NSObject { 8 | 9 | } 10 | 11 | @property (nonatomic, readonly) Facebook *facebook; 12 | @property (nonatomic, copy) NSString *facebookApplicationId; 13 | 14 | + (FacebookServices *)sharedFacebookServices; 15 | - (void)authorizeForPermissions:(NSArray *)permission; 16 | 17 | // defaults 18 | - (BOOL)facebookAuthorizedForPermissions:(NSArray *)permissions; 19 | - (void)setFacebookAuthorizedForPemissions:(NSArray *)permissions remove:(BOOL)remove; 20 | - (void)removeAllFacebookAuthorizedPermissions; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Source/CustomToolBar.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | // some ideas from: 4 | // http://stackoverflow.com/questions/1869331/set-programmatically-a-custom-subclass-of-uinavigationbar-in-uinavigationcontroll 5 | // some code from: 6 | // http://idevrecipes.com/2011/01/12/how-do-iphone-apps-instagramreederdailybooth-implement-custom-navigationbar-with-variable-width-back-buttons/ 7 | 8 | @interface CustomToolbar : UIToolbar { 9 | 10 | } 11 | 12 | - (UIImage *)backgroundImageForStyle:(UIBarStyle)barStyle; 13 | - (void)setBackgroundImage:(UIImage *)backgroundImage forBarStyle:(UIBarStyle)aBarStyle; 14 | - (void)clearBackground; 15 | 16 | - (UIImage *)shadowImageForStyle:(UIBarStyle)barStyle; 17 | - (void)setShadowImage:(UIImage *)shadowImage forBarStyle:(UIBarStyle)aBarStyle; 18 | - (void)clearShadow; 19 | 20 | - (void)setupCustomInitialisation; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Source/ObjectiveDump3.h: -------------------------------------------------------------------------------- 1 | #import "BaseASIServices.h" 2 | #import "TwitterServices.h" 3 | #import "FacebookServices.h" 4 | #import "NSDictionary+Persistence.h" 5 | #import "NSObject+Persistence.h" 6 | #import "BaseASIServices+Utils.h" 7 | #import "BaseTableViewController.h" 8 | #import "CustomSearchBar.h" 9 | #import "BaseTableViewRefreshController.h" 10 | #import "NSDate+Extensions.h" 11 | #import "UISearchDisplayController+Custom.h" 12 | #import "UINavigationController+Custom.h" 13 | #import "NSObject+Extensions.h" 14 | #import "MyLocationGetter.h" 15 | #import "CustomToolBar.h" 16 | #import "CustomNavigationController.h" 17 | #import "CustomNavigationBar.h" 18 | #import "ChoicesListDataSource.h" 19 | #import "BaseWebViewController.h" 20 | #import "BaseViewController.h" 21 | #import "BaseTableViewDataSource.h" 22 | #import "BaseLoadingViewCenter.h" 23 | #import "AccessoryViewWithImage.h" -------------------------------------------------------------------------------- /Source/TwitterServices.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "OAuth.h" 3 | #import "TwitterLoginPopupDelegate.h" 4 | #import "TwitterLoginUiFeedback.h" 5 | #import "CustomLoginPopup.h" 6 | 7 | #define TwitterNotification @"TwitterDidLoginNotification" 8 | #define TwitterAuthorizedUserDefaults @"TwitterAuthorizedUserDefaults" 9 | 10 | @interface TwitterServices : NSObject { 11 | 12 | } 13 | 14 | @property (nonatomic, readonly) OAuth *oAuth; 15 | @property (nonatomic, readonly) CustomLoginPopup *loginPopup; 16 | @property (nonatomic, copy) NSString *oauthConsumerKey; 17 | @property (nonatomic, copy) NSString *oauthConsumerSecret; 18 | 19 | + (TwitterServices *)sharedTwitterServices; 20 | 21 | - (BOOL)authorizeInNavController:(UINavigationController *)navController; 22 | 23 | // defaults 24 | @property (nonatomic) BOOL twitterAuthorized; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Source/CustomNavigationBar.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | // some ideas from: 4 | // http://stackoverflow.com/questions/1869331/set-programmatically-a-custom-subclass-of-uinavigationbar-in-uinavigationcontroll 5 | // some code from: 6 | // http://idevrecipes.com/2011/01/12/how-do-iphone-apps-instagramreederdailybooth-implement-custom-navigationbar-with-variable-width-back-buttons/ 7 | 8 | @interface CustomNavigationBar : UINavigationBar { 9 | 10 | } 11 | 12 | - (UIImage *)backgroundImageForStyle:(UIBarStyle)barStyle; 13 | - (void)setBackgroundImage:(UIImage *)backgroundImage forBarStyle:(UIBarStyle)aBarStyle; 14 | - (void)clearBackground; 15 | 16 | + (UIButton *)customBackButtonForBackgroundImage:(UIImage*)backgroundImage 17 | highlightedImage:(UIImage*)highlightedImage 18 | leftCapWidth:(CGFloat)leftCapWidth 19 | title:(NSString *)title 20 | font:(UIFont *)font; 21 | 22 | - (void)setupCustomInitialisation; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Source/BaseLoadingViewCenter.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface BaseLoadingViewCenter : NSObject { 4 | } 5 | 6 | + (BaseLoadingViewCenter *)sharedBaseLoadingViewCenter; 7 | 8 | @property (nonatomic, readonly) NSMutableDictionary *keyedObservers; 9 | 10 | - (void)addObserver:(NSObject *)observer forKey:(NSString *)key; 11 | - (void)removeObserver:(NSObject *)observer forKey:(NSString *)key; 12 | 13 | - (void)didStartLoadingForKey:(NSString *)key; 14 | - (void)didStopLoadingForKey:(NSString *)key; 15 | - (void)showErrorMsg:(NSString *)errorMsg forKey:(NSString *)key; 16 | - (void)showErrorMsg:(NSString *)errorMsg details:(NSString *)details forKey:(NSString *)key; 17 | - (void)removeErrorMsgForKey:(NSString *)key; 18 | 19 | @end 20 | 21 | 22 | @protocol BaseLoadingViewCenterDelegate 23 | 24 | @required 25 | - (void)baseLoadingViewCenterDidStartForKey:(NSString *)key; 26 | - (void)baseLoadingViewCenterDidStopForKey:(NSString *)key; 27 | - (void)baseLoadingViewCenterShowErrorMsg:(NSString *)errorMsg forKey:(NSString *)key; 28 | - (void)baseLoadingViewCenterShowErrorMsg:(NSString *)errorMsg details:(NSString *)details forKey:(NSString *)key; 29 | - (void)baseLoadingViewCenterRemoveErrorMsgForKey:(NSString *)key; 30 | 31 | @end -------------------------------------------------------------------------------- /Source/ChoicesListDataSource.m: -------------------------------------------------------------------------------- 1 | #import "ChoicesListDataSource.h" 2 | 3 | @implementation ChoicesListDataSource 4 | 5 | #pragma mark - 6 | #pragma mark Content 7 | 8 | - (id)initWitChoicesList:(NSArray *)choicesList 9 | { 10 | if ((self = [super init])) { 11 | if (choicesList.count > 0) { 12 | [self.content addObjectsFromArray:choicesList]; 13 | } 14 | } 15 | return self; 16 | } 17 | 18 | - (NSString *)choiceForIndexPath:(NSIndexPath *)indexPath 19 | { 20 | return [self objectForIndexPath:indexPath]; 21 | } 22 | 23 | // Customize the appearance of table view cells. 24 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 25 | { 26 | #define ChoicesCellIdentifier @"ChoicesCellIdentifier" 27 | 28 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ChoicesCellIdentifier]; 29 | if (cell == nil) { 30 | cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ChoicesCellIdentifier] autorelease]; 31 | cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 32 | } 33 | 34 | NSString *choice = [self choiceForIndexPath:indexPath]; 35 | 36 | cell.textLabel.text = choice; 37 | 38 | return cell; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Source/NSObject+Persistence.m: -------------------------------------------------------------------------------- 1 | #import "NSObject+Persistence.h" 2 | 3 | 4 | @implementation NSObject (Persistence) 5 | 6 | - (NSString *)applicationDocumentsDirectory 7 | { 8 | return [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; 9 | } 10 | 11 | + (NSObject *)savedForKey:(NSString *)key 12 | { 13 | if (!key) { 14 | return nil; 15 | } 16 | 17 | key = [key stringByAppendingString:@".plist"]; 18 | 19 | NSString *applicationDocumentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; 20 | 21 | NSData *data = [NSData dataWithContentsOfFile:[applicationDocumentsDirectory stringByAppendingPathComponent:key]]; 22 | if(data.length == 0) { 23 | return nil; 24 | } 25 | 26 | return [NSKeyedUnarchiver unarchiveObjectWithData:data]; 27 | } 28 | 29 | - (void)saveForKey:(NSString *)key 30 | { 31 | key = [key stringByAppendingString:@".plist"]; 32 | NSString *path = [[self applicationDocumentsDirectory] stringByAppendingPathComponent:key]; 33 | 34 | NSData *data = [NSKeyedArchiver archivedDataWithRootObject:self]; 35 | if(data.length > 0) { 36 | [data writeToFile:path atomically:NO]; 37 | } else { 38 | NSFileManager *manager = [NSFileManager defaultManager]; 39 | [manager removeItemAtPath:path error:nil]; 40 | } 41 | } 42 | 43 | @end -------------------------------------------------------------------------------- /Source/BaseASIServices+Utils.m: -------------------------------------------------------------------------------- 1 | #import "BaseASIServices+Utils.h" 2 | 3 | @implementation BaseASIServices (utils) 4 | 5 | #pragma mark - 6 | #pragma mark Request Status 7 | 8 | #define BaseServicesNotificationUnknown @"BaseServicesNotificationUnknown" 9 | 10 | - (NSString *)notificationNameForRequest:(ASIHTTPRequest *)request 11 | { 12 | NSString *notificationName = [request.userInfo valueForKey:@"notificationName"]; 13 | return (notificationName) ? notificationName : BaseServicesNotificationUnknown; 14 | } 15 | 16 | - (void)informEmtpy:(BOOL)empty forKey:(NSString *)key 17 | { 18 | // TODO on main thread 19 | if (empty) { 20 | [[BaseLoadingViewCenter sharedBaseLoadingViewCenter]showErrorMsg:@"Empty Content!" forKey:key]; 21 | } else { 22 | [[BaseLoadingViewCenter sharedBaseLoadingViewCenter]removeErrorMsgForKey:key]; 23 | } 24 | } 25 | 26 | - (void)notifyDone:(NSDictionary *)dictionary 27 | { 28 | NSString *notificationName = [dictionary valueForKey:@"notificationName"]; 29 | id object = [dictionary valueForKey:@"object"]; 30 | 31 | [[NSNotificationCenter defaultCenter] postNotificationName:notificationName object:object]; 32 | [[BaseLoadingViewCenter sharedBaseLoadingViewCenter]didStopLoadingForKey:notificationName]; 33 | } 34 | 35 | - (void)notifyDone:(ASIHTTPRequest *)request object:(id)object; 36 | { 37 | NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys: 38 | [self notificationNameForRequest:request], @"notificationName", 39 | object, @"object", 40 | nil]; 41 | [self performSelectorOnMainThread:@selector(notifyDone:) withObject:dictionary waitUntilDone:YES]; 42 | } 43 | 44 | - (void)notifyFailed:(NSDictionary *)dictionary 45 | { 46 | NSString *notificationName = [dictionary valueForKey:@"notificationName"]; 47 | NSString *errorString = [dictionary valueForKey:@"errorString"]; 48 | 49 | [[BaseLoadingViewCenter sharedBaseLoadingViewCenter]showErrorMsg:errorString forKey:notificationName]; 50 | [[BaseLoadingViewCenter sharedBaseLoadingViewCenter]didStopLoadingForKey:notificationName]; 51 | } 52 | 53 | - (void)notifyFailed:(ASIHTTPRequest *)request withError:(NSString *)errorString 54 | { 55 | NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys: 56 | [self notificationNameForRequest:request], @"notificationName", 57 | errorString, @"errorString", 58 | nil]; 59 | [self performSelectorOnMainThread:@selector(notifyFailed:) withObject:dictionary waitUntilDone:YES]; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /Source/MyLocationGetter.m: -------------------------------------------------------------------------------- 1 | #import "MyLocationGetter.h" 2 | #import "BaseLoadingViewCenter.h" 3 | 4 | @implementation MyLocationGetter 5 | 6 | @synthesize locationManager; 7 | 8 | - (CLLocationManager *)locationManager 9 | { 10 | if (!locationManager) { 11 | locationManager = [[CLLocationManager alloc] init]; 12 | 13 | locationManager.delegate = self; 14 | locationManager.desiredAccuracy = kCLLocationAccuracyKilometer; 15 | // Set a movement threshold for new events 16 | locationManager.distanceFilter = 500; 17 | 18 | } 19 | return locationManager; 20 | } 21 | 22 | - (void)startUpdates 23 | { 24 | [[BaseLoadingViewCenter sharedBaseLoadingViewCenter]didStartLoadingForKey:GPSLocationFinding]; 25 | 26 | if ([CLLocationManager respondsToSelector:@selector(significantLocationChangeMonitoringAvailable)] && 27 | [CLLocationManager significantLocationChangeMonitoringAvailable]) { 28 | [self.locationManager startMonitoringSignificantLocationChanges]; 29 | } else { 30 | [self.locationManager startUpdatingLocation]; 31 | } 32 | } 33 | 34 | - (void)stopUpdates 35 | { 36 | if ([CLLocationManager significantLocationChangeMonitoringAvailable]) { 37 | [self.locationManager stopMonitoringSignificantLocationChanges]; 38 | } else { 39 | [self.locationManager stopUpdatingLocation]; 40 | } 41 | [[BaseLoadingViewCenter sharedBaseLoadingViewCenter]didStopLoadingForKey:GPSLocationFinding]; 42 | } 43 | 44 | 45 | // Delegate method from the CLLocationManagerDelegate protocol. 46 | - (void)locationManager:(CLLocationManager *)manager 47 | didUpdateToLocation:(CLLocation *)newLocation 48 | fromLocation:(CLLocation *)oldLocation 49 | { 50 | // Horizontal coordinates 51 | if (signbit(newLocation.horizontalAccuracy)) { 52 | // Invalid coordinate 53 | return; 54 | } 55 | 56 | [[BaseLoadingViewCenter sharedBaseLoadingViewCenter]didStopLoadingForKey:GPSLocationFinding]; 57 | 58 | // Tell everyone that gps got a fix 59 | [[NSNotificationCenter defaultCenter] postNotificationName:GPSLocationDidFix object:nil userInfo:nil]; 60 | } 61 | 62 | - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error 63 | { 64 | if ([error code] == kCLErrorDenied) { 65 | // should stop looking for coordinates 66 | [self.locationManager stopUpdatingLocation]; 67 | [[NSNotificationCenter defaultCenter] postNotificationName:GPSLocationDidStop object:nil userInfo:nil]; 68 | } 69 | } 70 | 71 | #pragma mark - 72 | #pragma mark dealloc 73 | 74 | - (void)dealloc 75 | { 76 | [locationManager release]; 77 | 78 | [super dealloc]; 79 | } 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /Source/NSDictionary+Persistence.m: -------------------------------------------------------------------------------- 1 | #import "NSDictionary+Persistence.h" 2 | 3 | 4 | @implementation NSDictionary (Persistence) 5 | 6 | - (NSString *)applicationDocumentsDirectory 7 | { 8 | return [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; 9 | } 10 | 11 | + (NSDictionary *)dictionaryWithContent:(NSArray *)content date:(NSDate *)date 12 | { 13 | NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: 14 | content, @"content", 15 | date, @"date", 16 | nil]; 17 | return dict; 18 | } 19 | 20 | - (id)objectUnderArray:(id)object forPathToId:(NSString *)pathToId forKey:(NSString *)key 21 | { 22 | NSMutableArray *array = [NSMutableArray arrayWithArray:[self valueForKey:key]]; 23 | NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K == %@", pathToId, [object valueForKey:pathToId]]; 24 | NSArray *filteredArray = [array filteredArrayUsingPredicate:predicate]; 25 | return (filteredArray.count > 0) ? [filteredArray objectAtIndex:0] : nil; 26 | } 27 | 28 | - (id)filteredObjectsUnderArray:(id)object forPath:(NSString *)path forKey:(NSString *)key 29 | { 30 | NSMutableArray *array = [NSMutableArray arrayWithArray:[self valueForKey:key]]; 31 | NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K == %@", path, object]; 32 | return [array filteredArrayUsingPredicate:predicate]; 33 | } 34 | 35 | - (void)setObjectUnderArray:(id)object forPathToId:(NSString *)pathToId forKey:(NSString *)key 36 | { 37 | NSMutableArray *array = [NSMutableArray arrayWithArray:[self valueForKey:key]]; 38 | NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K == %@", pathToId, [object valueForKey:pathToId]]; 39 | NSArray *filteredArray = [array filteredArrayUsingPredicate:predicate]; 40 | if (filteredArray.count > 0) { 41 | NSInteger idx = [array indexOfObject:[filteredArray objectAtIndex:0]]; 42 | if (idx != NSNotFound) { 43 | [array replaceObjectAtIndex:idx withObject:object]; 44 | } 45 | } else { 46 | [array addObject:object]; 47 | } 48 | [self setValue:array forKey:key]; 49 | } 50 | 51 | - (void)removeObjectUnderArray:(id)object forPathToId:(NSString *)pathToId forKey:(NSString *)key 52 | { 53 | NSMutableArray *array = [NSMutableArray arrayWithArray:[self valueForKey:key]]; 54 | NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K == %@", pathToId, [object valueForKey:pathToId]]; 55 | NSArray *filteredArray = [array filteredArrayUsingPredicate:predicate]; 56 | for (id foundObject in filteredArray) { 57 | [array removeObject:foundObject]; 58 | } 59 | [self setValue:array forKey:key]; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /Source/NSDate+Extensions.m: -------------------------------------------------------------------------------- 1 | #import "NSDate+Extensions.h" 2 | #import "NSDate-Utilities.h" 3 | 4 | @implementation NSDate (Extensions) 5 | 6 | // ripoff https://github.com/billymeltdown/nsdate-helper/network but with fixes 7 | 8 | + (NSString *)stringForDisplayFromDate:(NSDate *)date 9 | { 10 | return [self stringForDisplayFromDate:date prefixed:NO]; 11 | } 12 | 13 | + (NSString *)stringForDisplayFromDate:(NSDate *)date prefixed:(BOOL)prefixed 14 | { 15 | return [self stringForDisplayFromDate:date prefixed:NO alwaysShowTime:FALSE]; 16 | } 17 | 18 | + (NSString *)stringForDisplayFromDate:(NSDate *)date prefixed:(BOOL)prefixed alwaysShowTime:(BOOL)showTime 19 | { 20 | /* 21 | * if the date is in today, display 12-hour time with meridian, 22 | * if it is within the last 7 days, display weekday name (Friday) 23 | * if within the calendar year, display as Jan 23 24 | * else display as Nov 11, 2008 25 | */ 26 | 27 | NSDateFormatter *displayFormatter = [[[NSDateFormatter alloc] init]autorelease]; 28 | NSString *displayString = nil; 29 | 30 | // comparing against midnight 31 | if ([date isToday]) { 32 | if (prefixed) { 33 | [displayFormatter setDateFormat:@"'at' h:mm a"]; // at 11:30 am 34 | } else { 35 | [displayFormatter setDateFormat:@"h:mm a"]; // 11:30 am 36 | } 37 | } else { 38 | if ([date isThisWeek]) { 39 | [displayFormatter setDateFormat:@"EEEE"]; // Tuesday 40 | } else { 41 | if ([date isThisYear]) { 42 | [displayFormatter setDateFormat:@"MMM d"]; 43 | } else { 44 | [displayFormatter setDateFormat:@"MMM d, yyyy"]; 45 | } 46 | } 47 | if (prefixed) { 48 | NSString *dateFormat = [displayFormatter dateFormat]; 49 | NSString *prefix = @"'on' "; 50 | [displayFormatter setDateFormat:[prefix stringByAppendingString:dateFormat]]; 51 | } 52 | if (showTime) { 53 | NSString *dateFormat = [displayFormatter dateFormat]; 54 | NSString *time = @" 'at' h:mma"; 55 | [displayFormatter setDateFormat:[dateFormat stringByAppendingString:time]]; 56 | } 57 | } 58 | 59 | // use display formatter to return formatted date string 60 | displayString = [displayFormatter stringFromDate:date]; 61 | return displayString; 62 | } 63 | 64 | //http://stackoverflow.com/questions/2615833/objective-c-setting-nsdate-to-current-utc 65 | 66 | - (NSString *)getUTCDateWithformat:(NSString *)format 67 | { 68 | NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init]autorelease]; 69 | NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:@"UTC"]; 70 | [dateFormatter setTimeZone:timeZone]; 71 | [dateFormatter setDateFormat:format]; 72 | NSString *dateString = [dateFormatter stringFromDate:self]; 73 | return dateString; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Source/BaseTableViewDataSource.m: -------------------------------------------------------------------------------- 1 | #import "BaseTableViewDataSource.h" 2 | 3 | 4 | @implementation BaseTableViewDataSource 5 | 6 | @synthesize content; 7 | 8 | #pragma mark - 9 | #pragma mark Content 10 | 11 | - (NSMutableArray *)content 12 | { 13 | if (!content) { 14 | content = [[NSMutableArray alloc]init]; 15 | } 16 | return content; 17 | } 18 | 19 | #pragma mark - 20 | #pragma mark Reset Content 21 | 22 | - (void)resetContent 23 | { 24 | // refresh content 25 | [self.content removeAllObjects]; 26 | } 27 | 28 | #pragma mark - 29 | #pragma mark Table view methods 30 | 31 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 32 | { 33 | // Check if content first elemetn return array or not 34 | // If yes, tableview has more than one section 35 | if (self.content && self.content.count > 0 36 | && [[self.content objectAtIndex:0]respondsToSelector:@selector(objectAtIndex:)]) { 37 | return self.content.count; 38 | } 39 | return 1; 40 | } 41 | 42 | 43 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 44 | { 45 | // Check if content first elemetn return array or not 46 | // If yes, tableview has more than one section 47 | if (self.content && self.content.count > section 48 | && [[self.content objectAtIndex:section]respondsToSelector:@selector(objectAtIndex:)]) { 49 | return [[self.content objectAtIndex:section]count]; 50 | } 51 | return self.content.count; 52 | } 53 | 54 | 55 | // Customize the appearance of table view cells. 56 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 57 | { 58 | #define MyCellIdentifier @"MyCellIdentifier" 59 | 60 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyCellIdentifier]; 61 | if (cell == nil) { 62 | cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyCellIdentifier] autorelease]; 63 | } 64 | 65 | return cell; 66 | } 67 | 68 | #pragma mark - 69 | #pragma mark Table view methods helper 70 | 71 | - (id)objectForIndexPath:(NSIndexPath *)indexPath; 72 | { 73 | // Hack to see if array has got multiple sections or not 74 | NSArray *firstLevel = nil; 75 | if (self.content && self.content.count > indexPath.section 76 | && [[self.content objectAtIndex:indexPath.section]respondsToSelector:@selector(objectAtIndex:)] 77 | && self.content.count>indexPath.section) { 78 | firstLevel = [self.content objectAtIndex:indexPath.section]; 79 | } else { 80 | firstLevel = self.content; 81 | } 82 | // if nothing return nil 83 | return (firstLevel.count>indexPath.row)?[firstLevel objectAtIndex:indexPath.row]:nil; 84 | } 85 | 86 | - (void)dealloc 87 | { 88 | [content release]; 89 | 90 | [super dealloc]; 91 | } 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /Source/BaseTableViewRefreshController.m: -------------------------------------------------------------------------------- 1 | #import "BaseTableViewRefreshController.h" 2 | 3 | 4 | @implementation BaseTableViewRefreshController 5 | 6 | @synthesize refreshHeaderView; 7 | 8 | #pragma mark - 9 | #pragma mark Setup 10 | 11 | - (EGORefreshTableHeaderView *)refreshHeaderView 12 | { 13 | if (!refreshHeaderView) { 14 | refreshHeaderView = [[EGORefreshTableHeaderView alloc] initWithFrame:CGRectMake(00.0f, 15 | 0.0f - self.tableView.bounds.size.height, 16 | self.view.frame.size.width, 17 | self.tableView.bounds.size.height)]; 18 | refreshHeaderView.delegate = self; 19 | [self.tableView addSubview:refreshHeaderView]; 20 | 21 | // update the last update date 22 | [refreshHeaderView refreshLastUpdatedDate]; 23 | } 24 | 25 | return refreshHeaderView; 26 | } 27 | 28 | #pragma mark - 29 | #pragma mark Content reloading 30 | 31 | - (void)hideRefreshHeaderView 32 | { 33 | [self.refreshHeaderView egoRefreshScrollViewDataSourceDidFinishedLoading:self.tableView]; 34 | } 35 | 36 | #pragma mark - 37 | #pragma mark BaseLoadingViewCenter Delegate 38 | 39 | - (void)baseLoadingViewCenterDidStopForKey:(NSString *)key 40 | { 41 | [super baseLoadingViewCenterDidStopForKey:key]; 42 | 43 | [self hideRefreshHeaderView]; 44 | } 45 | 46 | #pragma mark - 47 | #pragma mark UIScrollView Delegate 48 | 49 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView 50 | { 51 | if ([scrollView isEqual:self.searchDisplayController.searchResultsTableView]) { 52 | return; 53 | } 54 | [self.refreshHeaderView egoRefreshScrollViewDidScroll:scrollView]; 55 | } 56 | 57 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate 58 | { 59 | if ([scrollView isEqual:self.searchDisplayController.searchResultsTableView]) { 60 | return; 61 | } 62 | [self.refreshHeaderView egoRefreshScrollViewDidEndDragging:scrollView]; 63 | } 64 | 65 | #pragma mark - 66 | #pragma mark EGORefreshTableHeaderDelegate 67 | 68 | - (void)egoRefreshTableHeaderDidTriggerRefresh:(EGORefreshTableHeaderView*)view 69 | { 70 | // Refresh here 71 | } 72 | 73 | - (BOOL)egoRefreshTableHeaderDataSourceIsLoading:(EGORefreshTableHeaderView*)view 74 | { 75 | return FALSE; 76 | } 77 | 78 | - (NSDate*)egoRefreshTableHeaderDataSourceLastUpdated:(EGORefreshTableHeaderView*)view 79 | { 80 | return [NSDate date]; // should return date data source was last changed 81 | } 82 | 83 | #pragma mark - 84 | #pragma mark Memory managedment 85 | 86 | - (void)viewDidUnload { 87 | [super viewDidUnload]; 88 | 89 | [refreshHeaderView release]; 90 | refreshHeaderView = nil; 91 | } 92 | 93 | #pragma mark - 94 | #pragma mark Dealloc 95 | 96 | - (void)dealloc 97 | { 98 | [refreshHeaderView release]; 99 | 100 | [super dealloc]; 101 | } 102 | 103 | @end 104 | -------------------------------------------------------------------------------- /Source/FacebookServices.m: -------------------------------------------------------------------------------- 1 | #import "FacebookServices.h" 2 | 3 | @implementation FacebookServices 4 | 5 | SYNTHESIZE_SINGLETON_FOR_CLASS(FacebookServices) 6 | 7 | @synthesize facebook, facebookApplicationId; 8 | 9 | - (Facebook *)facebook 10 | { 11 | if (!facebook) { 12 | facebook = [[Facebook alloc] init]; 13 | } 14 | 15 | return facebook; 16 | } 17 | 18 | - (void)authorizeForPermissions:(NSArray *)permissions 19 | { 20 | [self.facebook authorize:self.facebookApplicationId permissions:permissions delegate:self]; 21 | } 22 | 23 | #pragma mark - 24 | #pragma mark FBSessionDelegate 25 | 26 | - (void)fbDidLoginWithPermissions:(NSArray *)permissions; 27 | { 28 | DLog(@"Facebook accessToken: %@", self.facebook.accessToken); 29 | 30 | NSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys: 31 | [NSNumber numberWithBool:TRUE], @"success", 32 | permissions, @"permissions", 33 | nil]; 34 | [[NSNotificationCenter defaultCenter]postNotificationName:FacebookNotification object:infoDict]; 35 | } 36 | 37 | - (void)fbDidNotLogin:(BOOL)cancelled permissions:(NSArray *)permissions; 38 | { 39 | DLog(@"Facebook did not login"); 40 | 41 | NSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys: 42 | [NSNumber numberWithBool:FALSE], @"success", 43 | permissions, @"permissions", 44 | nil]; 45 | [[NSNotificationCenter defaultCenter]postNotificationName:FacebookNotification object:infoDict]; 46 | } 47 | 48 | - (void)fbDidLogout 49 | { 50 | DLog(@"Facebook did logout"); 51 | 52 | [self removeAllFacebookAuthorizedPermissions]; 53 | } 54 | 55 | #pragma mark - 56 | #pragma mark Defaults 57 | 58 | - (BOOL)facebookAuthorizedForPermissions:(NSArray *)permissions 59 | { 60 | NSArray *currentPermissions = [[NSUserDefaults standardUserDefaults]objectForKey:FacebookAuthorizedPermissionsUserDefaults]; 61 | BOOL authorized = TRUE; 62 | for (NSString *permission in permissions) { 63 | if (![currentPermissions containsObject:permission]) { 64 | authorized = FALSE; 65 | } 66 | } 67 | return authorized; 68 | } 69 | 70 | - (void)setFacebookAuthorizedForPemissions:(NSArray *)permissions remove:(BOOL)remove 71 | { 72 | NSMutableSet *currentPermissions = [NSMutableSet setWithArray:[[NSUserDefaults standardUserDefaults]objectForKey:FacebookAuthorizedPermissionsUserDefaults]]; 73 | 74 | for (NSString *permission in permissions) { 75 | if (remove) { 76 | [currentPermissions removeObject:permission]; 77 | } else { 78 | [currentPermissions addObject:permission]; 79 | } 80 | } 81 | 82 | [[NSUserDefaults standardUserDefaults]setObject:currentPermissions.allObjects forKey:FacebookAuthorizedPermissionsUserDefaults]; 83 | [[NSUserDefaults standardUserDefaults]synchronize]; 84 | } 85 | 86 | - (void)removeAllFacebookAuthorizedPermissions 87 | { 88 | [[NSUserDefaults standardUserDefaults]removeObjectForKey:FacebookAuthorizedPermissionsUserDefaults]; 89 | [[NSUserDefaults standardUserDefaults]synchronize]; 90 | } 91 | 92 | #pragma mark - 93 | #pragma mark Deallo 94 | 95 | - (void)dealloc { 96 | [facebookApplicationId release]; 97 | [facebook release]; 98 | 99 | [super dealloc]; 100 | } 101 | 102 | 103 | @end 104 | -------------------------------------------------------------------------------- /Source/BaseLoadingViewCenter.m: -------------------------------------------------------------------------------- 1 | #import "BaseLoadingViewCenter.h" 2 | #import "SynthesizeSingleton.h" 3 | 4 | @implementation BaseLoadingViewCenter 5 | 6 | SYNTHESIZE_SINGLETON_FOR_CLASS(BaseLoadingViewCenter) 7 | 8 | @synthesize keyedObservers; 9 | 10 | - (NSMutableDictionary *)keyedObservers 11 | { 12 | // does not retain observers 13 | if (!keyedObservers) { 14 | keyedObservers = [[NSMutableDictionary alloc]init]; 15 | } 16 | 17 | return keyedObservers; 18 | } 19 | 20 | - (void)addObserver:(NSObject *)observer forKey:(NSString *)key 21 | { 22 | if (!observer || !key) { 23 | return; 24 | } 25 | 26 | NSMutableArray *observers = [NSMutableArray arrayWithArray:[self.keyedObservers valueForKey:key]]; 27 | if (![observers containsObject:[NSValue valueWithNonretainedObject:observer]]) { 28 | // Don't want to retain the observer 29 | [observers addObject:[NSValue valueWithNonretainedObject:observer]]; 30 | } 31 | [self.keyedObservers setValue:observers forKey:key]; 32 | } 33 | 34 | - (void)removeObserver:(NSObject *)observer forKey:(NSString *)key 35 | { 36 | if (!observer || !key) { 37 | return; 38 | } 39 | 40 | NSMutableArray *observers = [NSMutableArray arrayWithArray:[self.keyedObservers valueForKey:key]]; 41 | [observers removeObject:[NSValue valueWithNonretainedObject:observer]]; 42 | [self.keyedObservers setValue:observers forKey:key]; 43 | } 44 | 45 | - (void)didStartLoadingForKey:(NSString *)key 46 | { 47 | if (!key) { 48 | return; 49 | } 50 | 51 | NSArray *observers = [self.keyedObservers valueForKey:key]; 52 | for (NSValue *value in observers) { 53 | id object = [value nonretainedObjectValue]; 54 | [object baseLoadingViewCenterDidStartForKey:key]; 55 | } 56 | } 57 | 58 | - (void)didStopLoadingForKey:(NSString *)key 59 | { 60 | if (!key) { 61 | return; 62 | } 63 | 64 | NSArray *observers = [self.keyedObservers valueForKey:key]; 65 | for (NSValue *value in observers) { 66 | id object = [value nonretainedObjectValue]; 67 | [object baseLoadingViewCenterDidStopForKey:key]; 68 | } 69 | } 70 | 71 | - (void)showErrorMsg:(NSString *)errorMsg forKey:(NSString *)key 72 | { 73 | if (!key) { 74 | return; 75 | } 76 | 77 | NSArray *observers = [self.keyedObservers valueForKey:key]; 78 | for (NSValue *value in observers) { 79 | id object = [value nonretainedObjectValue]; 80 | [object baseLoadingViewCenterShowErrorMsg:errorMsg forKey:key]; 81 | } 82 | } 83 | 84 | - (void)showErrorMsg:(NSString *)errorMsg details:(NSString *)details forKey:(NSString *)key 85 | { 86 | if (!key) { 87 | return; 88 | } 89 | 90 | NSArray *observers = [self.keyedObservers valueForKey:key]; 91 | for (NSValue *value in observers) { 92 | id object = [value nonretainedObjectValue]; 93 | [object baseLoadingViewCenterShowErrorMsg:errorMsg details:details forKey:key]; 94 | } 95 | } 96 | 97 | - (void)removeErrorMsgForKey:(NSString *)key 98 | { 99 | if (!key) { 100 | return; 101 | } 102 | 103 | NSArray *observers = [self.keyedObservers valueForKey:key]; 104 | for (NSValue *value in observers) { 105 | id object = [value nonretainedObjectValue]; 106 | [object baseLoadingViewCenterRemoveErrorMsgForKey:key]; 107 | } 108 | } 109 | 110 | - (void)dealloc 111 | { 112 | [keyedObservers release]; 113 | 114 | [super dealloc]; 115 | } 116 | 117 | @end 118 | -------------------------------------------------------------------------------- /Source/AccessoryViewWithImage.m: -------------------------------------------------------------------------------- 1 | #import "AccessoryViewWithImage.h" 2 | 3 | 4 | @implementation AccessoryViewWithImage 5 | 6 | @synthesize leftRightDiff; 7 | 8 | #pragma mark - 9 | #pragma mark Initialization 10 | 11 | // The designated initializer. Override to perform setup that is required before the view is loaded. 12 | // Only when xibless (interface buildder) 13 | - (id)initWithFrame:(CGRect)frame { 14 | self = [super initWithFrame:frame]; 15 | if (self) { 16 | // Custom initialization 17 | [self setupCustomInitialisation]; 18 | } 19 | return self; 20 | } 21 | 22 | // The designated initializer. Override to perform setup that is required before the view is loaded. 23 | // Only when using xib (interface buildder) 24 | - (id)initWithCoder:(NSCoder *)decoder { 25 | self = [super initWithCoder:decoder]; 26 | if (self) { 27 | // Custom initialization 28 | [self setupCustomInitialisation]; 29 | } 30 | return self; 31 | } 32 | 33 | - (void)setupCustomInitialisation 34 | { 35 | // Initialization code 36 | self.backgroundColor = [UIColor clearColor]; 37 | self.leftRightDiff = 0.0; 38 | } 39 | 40 | - (UIImageView *)imageView 41 | { 42 | if (!_imageView) { 43 | _imageView = [[UIImageView alloc]initWithFrame:CGRectZero]; 44 | [self addSubview:_imageView]; 45 | } 46 | return _imageView; 47 | } 48 | 49 | - (void)setleftRightDiff:(CGFloat)aLeftRightDiff 50 | { 51 | if (leftRightDiff != aLeftRightDiff) { 52 | leftRightDiff = aLeftRightDiff; 53 | [self setNeedsLayout]; 54 | } 55 | } 56 | 57 | +(id)accessoryViewWithImageNamed:(NSString *)imageNamed highlightedImageNamed:(NSString *)highlightedImageNamed cellHeight:(CGFloat)cellHeight 58 | { 59 | AccessoryViewWithImage *accessoryView = [[[AccessoryViewWithImage alloc]initWithFrame:CGRectZero]autorelease]; 60 | UIImage *image = [UIImage imageNamed:imageNamed]; 61 | accessoryView.frame = CGRectIntegral(CGRectMake(accessoryView.frame.origin.x - image.size.width, accessoryView.frame.origin.y, image.size.width + (accessoryView.leftRightDiff * 2.0), cellHeight)); 62 | accessoryView.imageView.image = image; 63 | accessoryView.imageView.highlightedImage = [UIImage imageNamed:highlightedImageNamed]; 64 | return accessoryView; 65 | } 66 | 67 | +(id)accessoryViewWithImageNamed:(NSString *)imageNamed highlightedImageNamed:(NSString *)highlightedImageNamed cellHeight:(CGFloat)cellHeight leftRightDiff:(CGFloat)leftRightDiff 68 | { 69 | AccessoryViewWithImage *accessoryView = [[[AccessoryViewWithImage alloc]initWithFrame:CGRectZero]autorelease]; 70 | UIImage *image = [UIImage imageNamed:imageNamed]; 71 | accessoryView.leftRightDiff = leftRightDiff; 72 | accessoryView.frame = CGRectIntegral(CGRectMake(accessoryView.frame.origin.x - image.size.width, accessoryView.frame.origin.y, image.size.width + (accessoryView.leftRightDiff * 2.0), cellHeight)); 73 | accessoryView.imageView.image = image; 74 | accessoryView.imageView.highlightedImage = [UIImage imageNamed:highlightedImageNamed]; 75 | return accessoryView; 76 | } 77 | 78 | 79 | - (void)layoutSubviews 80 | { 81 | [super layoutSubviews]; 82 | 83 | if (self.imageView.image) { 84 | CGRect rect = self.bounds; 85 | self.imageView.frame = CGRectIntegral(CGRectMake((rect.size.width - self.imageView.image.size.width) / 2.0, 86 | (rect.size.height - self.imageView.image.size.height) / 2.0, 87 | self.imageView.image.size.width, 88 | self.imageView.image.size.height)); 89 | } 90 | } 91 | 92 | 93 | - (void)dealloc 94 | { 95 | [_imageView release]; 96 | 97 | [super dealloc]; 98 | } 99 | 100 | 101 | 102 | @end 103 | -------------------------------------------------------------------------------- /Source/BaseTableViewController.m: -------------------------------------------------------------------------------- 1 | #import "BaseTableViewController.h" 2 | 3 | 4 | @implementation BaseTableViewController 5 | 6 | @synthesize tableView, searchString; 7 | 8 | #pragma mark - 9 | #pragma mark Initialisation 10 | 11 | // The designated initializer. Override to perform setup that is required before the view is loaded. 12 | // Only when xibless (interface buildder) 13 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 14 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 15 | if (self) { 16 | // Custom initialization 17 | [self setupCustomInitialisation]; 18 | } 19 | return self; 20 | } 21 | 22 | // The designated initializer. Override to perform setup that is required before the view is loaded. 23 | // Only when using xib (interface buildder) 24 | - (id)initWithCoder:(NSCoder *)decoder { 25 | self = [super initWithCoder:decoder]; 26 | if (self) { 27 | // Custom initialization 28 | [self setupCustomInitialisation]; 29 | } 30 | return self; 31 | } 32 | 33 | - (void)setupCustomInitialisation 34 | { 35 | 36 | } 37 | 38 | - (void)viewDidLoad 39 | { 40 | [super viewDidLoad]; 41 | 42 | [self setupDataSource]; 43 | [self setupSearchDataSource]; 44 | } 45 | 46 | #pragma mark - 47 | #pragma mark Setup 48 | 49 | - (void)setupDataSource 50 | { 51 | 52 | } 53 | 54 | - (void)setupSearchDataSource 55 | { 56 | 57 | } 58 | 59 | #pragma mark - 60 | #pragma mark tableView Delegate 61 | 62 | - (BOOL)isIndexPathLastRow:(NSIndexPath *)indexPath 63 | { 64 | return ([self.tableView numberOfRowsInSection:indexPath.section] - 1 == indexPath.row); 65 | } 66 | 67 | - (BOOL)isIndexPathSingleRow:(NSIndexPath *)indexPath 68 | { 69 | return ([self.tableView numberOfRowsInSection:indexPath.section] == 1); 70 | } 71 | 72 | - (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 73 | 74 | 75 | [aTableView deselectRowAtIndexPath:indexPath animated:TRUE]; 76 | 77 | } 78 | 79 | #pragma mark - 80 | #pragma mark Content reloading 81 | 82 | - (void)shouldReloadContent:(NSNotification *)notification 83 | { 84 | [super shouldReloadContent:notification]; 85 | 86 | [self.tableView reloadData]; 87 | } 88 | 89 | #pragma mark - 90 | #pragma mark UISearchDisplayDelegate 91 | 92 | // return YES to reload table. called when search string/option changes. convenience methods on top UISearchBar delegate methods 93 | - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)aSearchString 94 | { 95 | if ([aSearchString isEqualToString:self.searchString]) { 96 | return FALSE; 97 | } 98 | self.searchString = aSearchString; 99 | [self filterContentForSearchText:aSearchString scope: 100 | [[controller.searchBar scopeButtonTitles] objectAtIndex:[controller.searchBar selectedScopeButtonIndex]]]; 101 | return TRUE; 102 | } 103 | 104 | - (void)searchDisplayControllerDidEndSearch:(UISearchDisplayController *)controller 105 | { 106 | self.searchString = nil; 107 | } 108 | 109 | #pragma mark - 110 | #pragma mark Content Filtering 111 | 112 | - (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope 113 | { 114 | [self.searchDisplayController.searchResultsTableView reloadData]; 115 | } 116 | 117 | #pragma mark - 118 | #pragma mark Memory 119 | 120 | - (void)viewDidUnload { 121 | self.tableView = nil; 122 | 123 | [super viewDidUnload]; 124 | } 125 | 126 | /* 127 | // Override to allow orientations other than the default portrait orientation. 128 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 129 | // Return YES for supported orientations 130 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 131 | } 132 | */ 133 | 134 | 135 | - (void)dealloc 136 | { 137 | [tableView release]; 138 | [searchString release]; 139 | 140 | [super dealloc]; 141 | } 142 | 143 | @end 144 | -------------------------------------------------------------------------------- /Source/CustomSearchBar.m: -------------------------------------------------------------------------------- 1 | #import "CustomSearchBar.h" 2 | 3 | @interface CustomSearchBar () 4 | 5 | @property (nonatomic, readonly) NSMutableDictionary *backgroundImagesDict; 6 | @property (nonatomic, readonly) UIView *customBackgroundView; 7 | 8 | @end 9 | 10 | 11 | @implementation CustomSearchBar 12 | 13 | @synthesize backgroundImagesDict; 14 | 15 | #pragma mark - Init 16 | 17 | // The designated initializer. Override to perform setup that is required before the view is loaded. 18 | // Only when xibless (interface buildder) 19 | - (id)initWithFrame:(CGRect)frame { 20 | self = [super initWithFrame:frame]; 21 | if (self) { 22 | // Custom initialization 23 | [self setupCustomInitialisation]; 24 | } 25 | return self; 26 | } 27 | 28 | // The designated initializer. Override to perform setup that is required before the view is loaded. 29 | // Only when using xib (interface buildder) 30 | - (id)initWithCoder:(NSCoder *)decoder { 31 | self = [super initWithCoder:decoder]; 32 | if (self) { 33 | // Custom initialization 34 | [self setupCustomInitialisation]; 35 | } 36 | return self; 37 | } 38 | 39 | - (void)setupCustomInitialisation 40 | { 41 | // Initialization code 42 | // Nothing 43 | } 44 | 45 | #pragma mark - 46 | #pragma mark BackgroundImage 47 | 48 | - (NSMutableDictionary *)backgroundImagesDict 49 | { 50 | if (!backgroundImagesDict) { 51 | backgroundImagesDict = [[NSMutableDictionary alloc]init]; 52 | } 53 | 54 | return backgroundImagesDict; 55 | } 56 | 57 | - (UIImage *)backgroundImageForStyle:(UIBarStyle)aBarStyle 58 | { 59 | return [self.backgroundImagesDict objectForKey:[NSNumber numberWithInteger:aBarStyle]]; 60 | } 61 | 62 | - (void)setBackgroundImage:(UIImage *)backgroundImage forBarStyle:(UIBarStyle)aBarStyle; 63 | { 64 | if (backgroundImage) { 65 | [self.backgroundImagesDict setObject:backgroundImage forKey:[NSNumber numberWithInteger:aBarStyle]]; 66 | } else { 67 | [self.backgroundImagesDict removeObjectForKey:[NSNumber numberWithInteger:aBarStyle]]; 68 | } 69 | 70 | [self layoutSubviews]; 71 | } 72 | 73 | - (void)clearBackground 74 | { 75 | [self.backgroundImagesDict removeAllObjects]; 76 | [self layoutSubviews]; 77 | } 78 | 79 | #pragma mark - Background hax 80 | 81 | - (UIView *)customBackgroundView 82 | { 83 | NSString *stringClass = [NSString stringWithFormat:@"UISearchBar%@", @"Background"]; 84 | for (UIView *view in self.subviews) { 85 | if ([view isKindOfClass:NSClassFromString(stringClass)]) { 86 | return view; 87 | } 88 | } 89 | return nil; 90 | } 91 | 92 | #pragma mark - 93 | #pragma mark Drawing 94 | 95 | - (void)drawRect:(CGRect)rect 96 | { 97 | // Drawing code. 98 | UIImage *backgroundImage = [self backgroundImageForStyle:self.barStyle]; 99 | if (backgroundImage) { 100 | [backgroundImage drawInRect:rect]; 101 | } else { 102 | [super drawRect:rect]; 103 | } 104 | } 105 | 106 | - (void)layoutSubviews{ 107 | [super layoutSubviews]; 108 | 109 | UIImage *backgroundImage = [self backgroundImageForStyle:self.barStyle]; 110 | self.customBackgroundView.hidden = (backgroundImage != nil); 111 | } 112 | 113 | #pragma mark - Keyboard 114 | 115 | - (UIKeyboardAppearance)keyboardAppearance 116 | { 117 | for(UIView *subView in self.subviews) { 118 | if([subView isKindOfClass: [UITextField class]]) { 119 | return [(UITextField *)subView keyboardAppearance]; 120 | } 121 | } 122 | 123 | return UIKeyboardAppearanceDefault; 124 | } 125 | 126 | - (void)setKeyboardAppearance:(UIKeyboardAppearance)keyboardAppearance 127 | { 128 | for(UIView *subView in self.subviews) { 129 | if([subView isKindOfClass: [UITextField class]]) { 130 | [(UITextField *)subView setKeyboardAppearance: UIKeyboardAppearanceAlert]; 131 | } 132 | } 133 | } 134 | 135 | #pragma mark - 136 | #pragma mark Dealloc 137 | 138 | - (void)dealloc 139 | { 140 | [backgroundImagesDict release]; 141 | 142 | [super dealloc]; 143 | } 144 | 145 | @end 146 | -------------------------------------------------------------------------------- /Source/CustomNavigationBar.m: -------------------------------------------------------------------------------- 1 | #import "CustomNavigationBar.h" 2 | 3 | @interface CustomNavigationBar () 4 | 5 | @property (nonatomic, readonly) NSMutableDictionary *backgroundImagesDict; 6 | 7 | @end 8 | 9 | @implementation CustomNavigationBar 10 | 11 | @synthesize backgroundImagesDict; 12 | 13 | // The designated initializer. Override to perform setup that is required before the view is loaded. 14 | // Only when xibless (interface buildder) 15 | - (id)initWithFrame:(CGRect)frame { 16 | self = [super initWithFrame:frame]; 17 | if (self) { 18 | // Custom initialization 19 | [self setupCustomInitialisation]; 20 | } 21 | return self; 22 | } 23 | 24 | // The designated initializer. Override to perform setup that is required before the view is loaded. 25 | // Only when using xib (interface buildder) 26 | - (id)initWithCoder:(NSCoder *)decoder { 27 | self = [super initWithCoder:decoder]; 28 | if (self) { 29 | // Custom initialization 30 | [self setupCustomInitialisation]; 31 | } 32 | return self; 33 | } 34 | 35 | - (void)setupCustomInitialisation 36 | { 37 | // Initialization code 38 | // Nothing 39 | } 40 | 41 | #pragma mark - 42 | #pragma mark BackgroundImage 43 | 44 | - (NSMutableDictionary *)backgroundImagesDict 45 | { 46 | if (!backgroundImagesDict) { 47 | backgroundImagesDict = [[NSMutableDictionary alloc]init]; 48 | } 49 | 50 | return backgroundImagesDict; 51 | } 52 | 53 | - (UIImage *)backgroundImageForStyle:(UIBarStyle)aBarStyle 54 | { 55 | return [self.backgroundImagesDict objectForKey:[NSNumber numberWithInteger:aBarStyle]]; 56 | } 57 | 58 | - (void)setBackgroundImage:(UIImage *)backgroundImage forBarStyle:(UIBarStyle)aBarStyle; 59 | { 60 | if (backgroundImage) { 61 | [self.backgroundImagesDict setObject:backgroundImage forKey:[NSNumber numberWithInteger:aBarStyle]]; 62 | } else { 63 | [self.backgroundImagesDict removeObjectForKey:[NSNumber numberWithInteger:aBarStyle]]; 64 | } 65 | 66 | [self setNeedsDisplay]; 67 | } 68 | 69 | - (void)clearBackground 70 | { 71 | [self.backgroundImagesDict removeAllObjects]; 72 | [self setNeedsDisplay]; 73 | } 74 | 75 | #pragma mark - 76 | #pragma mark Drawing 77 | 78 | - (void)drawRect:(CGRect)rect 79 | { 80 | // Drawing code. 81 | UIImage *backgroundImage = [self backgroundImageForStyle:self.barStyle]; 82 | if (backgroundImage) { 83 | [backgroundImage drawInRect:rect]; 84 | } else { 85 | [super drawRect:rect]; 86 | } 87 | } 88 | 89 | #pragma mark - 90 | #pragma mark BackButton 91 | 92 | // Given the prpoer images and cap width, create a variable width back button 93 | + (UIButton *)customBackButtonForBackgroundImage:(UIImage*)backgroundImage 94 | highlightedImage:(UIImage*)highlightedImage 95 | leftCapWidth:(CGFloat)leftCapWidth 96 | title:(NSString *)title 97 | font:(UIFont *)font 98 | { 99 | backgroundImage = [backgroundImage stretchableImageWithLeftCapWidth:leftCapWidth topCapHeight:0.0]; 100 | highlightedImage = [highlightedImage stretchableImageWithLeftCapWidth:leftCapWidth topCapHeight:0.0]; 101 | 102 | UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom]; 103 | 104 | button.titleEdgeInsets = UIEdgeInsetsMake(0, leftCapWidth, 0, 3.0); 105 | button.titleLabel.font = (font) ? font : [UIFont boldSystemFontOfSize:[UIFont smallSystemFontSize]]; 106 | [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 107 | button.titleLabel.shadowOffset = CGSizeMake(0,-1); 108 | [button setTitleShadowColor:[UIColor darkGrayColor] forState:UIControlStateNormal]; 109 | button.titleLabel.lineBreakMode = UILineBreakModeTailTruncation; 110 | 111 | [button setBackgroundImage:backgroundImage forState:UIControlStateNormal]; 112 | [button setBackgroundImage:highlightedImage forState:UIControlStateHighlighted]; 113 | 114 | CGSize textSize = [title sizeWithFont:button.titleLabel.font]; 115 | button.frame = CGRectMake(button.frame.origin.x, 116 | button.frame.origin.y, 117 | textSize.width + leftCapWidth + 3.0 + 5.0, 118 | backgroundImage.size.height); 119 | 120 | [button setTitle:title forState:UIControlStateNormal]; 121 | 122 | return button; 123 | } 124 | 125 | #pragma mark - 126 | #pragma mark Dealloc 127 | 128 | - (void)dealloc 129 | { 130 | [backgroundImagesDict release]; 131 | 132 | [super dealloc]; 133 | } 134 | 135 | 136 | @end 137 | -------------------------------------------------------------------------------- /Source/TwitterServices.m: -------------------------------------------------------------------------------- 1 | #import "TwitterServices.h" 2 | #import "OAuth+UserDefaults.h" 3 | 4 | @implementation TwitterServices 5 | 6 | SYNTHESIZE_SINGLETON_FOR_CLASS(TwitterServices) 7 | 8 | @synthesize oAuth, loginPopup, oauthConsumerKey, oauthConsumerSecret; 9 | 10 | - (OAuth *)oAuth 11 | { 12 | if (!oAuth) { 13 | oAuth = [[OAuth alloc] initWithConsumerKey:self.oauthConsumerKey andConsumerSecret:self.oauthConsumerSecret]; 14 | } 15 | 16 | return oAuth; 17 | } 18 | 19 | - (CustomLoginPopup *)loginPopup 20 | { 21 | if (!loginPopup) { 22 | loginPopup = [[CustomLoginPopup alloc] initWithNibName:@"TwitterLoginPopup" bundle:nil]; 23 | loginPopup.oAuth = self.oAuth; 24 | loginPopup.delegate = self; 25 | loginPopup.uiDelegate = self; 26 | } 27 | 28 | return loginPopup; 29 | } 30 | 31 | - (BOOL)authorizeInNavController:(UINavigationController *)navController 32 | { 33 | if (!self.oAuth.oauth_token_authorized) { 34 | //[self.oAuth loadOAuthTwitterContextFromUserDefaults]; 35 | UINavigationController *nav = [[[UINavigationController alloc] initWithRootViewController:self.loginPopup]autorelease]; 36 | [navController presentModalViewController:nav animated:YES]; 37 | return FALSE; 38 | } 39 | 40 | return TRUE; 41 | } 42 | 43 | #pragma mark - 44 | #pragma mark TwitterLoginPopupDelegate 45 | 46 | - (void)twitterLoginPopupDidCancel:(TwitterLoginPopup *)popup { 47 | [self.loginPopup dismissModalViewControllerAnimated:YES]; 48 | [loginPopup release]; loginPopup = nil; // was retained as ivar in "login" 49 | 50 | self.twitterAuthorized = FALSE; 51 | [[NSNotificationCenter defaultCenter]postNotificationName:TwitterNotification object:@"Unable to login to Twitter"]; 52 | } 53 | 54 | - (void)twitterLoginPopupDidAuthorize:(TwitterLoginPopup *)popup { 55 | [self.loginPopup dismissModalViewControllerAnimated:YES]; 56 | [loginPopup release]; 57 | loginPopup = nil; 58 | [oAuth saveOAuthTwitterContextToUserDefaults]; 59 | } 60 | 61 | #pragma mark - 62 | #pragma mark TwitterLoginUiFeedback 63 | 64 | - (void) tokenRequestDidStart:(TwitterLoginPopup *)twitterLogin { 65 | DLog(@"token request did start"); 66 | [loginPopup.activityIndicator startAnimating]; 67 | } 68 | 69 | - (void) tokenRequestDidSucceed:(TwitterLoginPopup *)twitterLogin { 70 | DLog(@"token request did succeed"); 71 | [loginPopup.activityIndicator stopAnimating]; 72 | } 73 | 74 | - (void) tokenRequestDidFail:(TwitterLoginPopup *)twitterLogin { 75 | DLog(@"token request did fail"); 76 | [loginPopup.activityIndicator stopAnimating]; 77 | } 78 | 79 | - (void) authorizationRequestDidStart:(TwitterLoginPopup *)twitterLogin { 80 | DLog(@"authorization request did start"); 81 | [loginPopup.activityIndicator startAnimating]; 82 | } 83 | 84 | - (void) authorizationRequestDidSucceed:(TwitterLoginPopup *)twitterLogin { 85 | DLog(@"Twitter oauth_token: %@", self.oAuth.oauth_token); 86 | 87 | [loginPopup.activityIndicator stopAnimating]; 88 | 89 | 90 | 91 | NSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys: 92 | [NSNumber numberWithBool:TRUE], @"success", 93 | nil]; 94 | [[NSNotificationCenter defaultCenter]postNotificationName:TwitterNotification object:infoDict]; 95 | } 96 | 97 | - (void) authorizationRequestDidFail:(TwitterLoginPopup *)twitterLogin { 98 | DLog(@"token request did fail"); 99 | [loginPopup.activityIndicator stopAnimating]; 100 | 101 | NSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys: 102 | [NSNumber numberWithBool:FALSE], @"success", 103 | nil]; 104 | [[NSNotificationCenter defaultCenter]postNotificationName:TwitterNotification object:infoDict]; 105 | } 106 | 107 | #pragma mark - 108 | #pragma mark twitterAuthorized 109 | 110 | - (BOOL)twitterAuthorized 111 | { 112 | return [[NSUserDefaults standardUserDefaults]boolForKey:TwitterAuthorizedUserDefaults]; 113 | } 114 | 115 | - (void)setTwitterAuthorized:(BOOL)twitterAuthorized 116 | { 117 | [[NSUserDefaults standardUserDefaults]setBool:twitterAuthorized forKey:TwitterAuthorizedUserDefaults]; 118 | [[NSUserDefaults standardUserDefaults]synchronize]; 119 | } 120 | 121 | - (void)dealloc { 122 | [oauthConsumerSecret release]; 123 | [oauthConsumerKey release]; 124 | [loginPopup release]; 125 | [oAuth release]; 126 | 127 | [super dealloc]; 128 | } 129 | 130 | 131 | @end 132 | -------------------------------------------------------------------------------- /Source/BaseASIServices.m: -------------------------------------------------------------------------------- 1 | #import "BaseASIServices.h" 2 | #import "BaseASIServices+Utils.h" 3 | 4 | @implementation BaseASIServices 5 | 6 | @synthesize networkQueue; 7 | 8 | - (id) init 9 | { 10 | self = [super init]; 11 | if (self != nil) { 12 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillResignActive) name:UIApplicationWillResignActiveNotification object:nil]; 13 | 14 | } 15 | return self; 16 | } 17 | 18 | - (void)applicationWillResignActive 19 | { 20 | 21 | } 22 | 23 | 24 | - (ASINetworkQueue *)networkQueue 25 | { 26 | if (!networkQueue) { 27 | networkQueue = [[ASINetworkQueue alloc] init]; 28 | if ([self respondsToSelector:@selector(fetchStarted:)]) { 29 | [networkQueue setRequestDidStartSelector:@selector(fetchStarted:)]; 30 | } 31 | if ([self respondsToSelector:@selector(fetchCompleted:)]) { 32 | [networkQueue setRequestDidFinishSelector:@selector(fetchCompleted:)]; 33 | } 34 | if ([self respondsToSelector:@selector(fetchFailed:)]) { 35 | [networkQueue setRequestDidFailSelector:@selector(fetchFailed:)]; 36 | } 37 | if ([self respondsToSelector:@selector(queueFinished:)]) { 38 | [networkQueue setQueueDidFinishSelector:@selector(queueFinished:)]; 39 | } 40 | 41 | [networkQueue setDelegate:self]; 42 | } 43 | 44 | return networkQueue; 45 | } 46 | 47 | #pragma mark - 48 | #pragma mark Request Constructors 49 | 50 | - (ASIHTTPRequest *)requestWithUrl:(NSString *)url 51 | { 52 | ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:url]]; 53 | request.numberOfTimesToRetryOnTimeout = 1; 54 | request.timeOutSeconds = RequestTimeOutSeconds; 55 | 56 | request.allowCompressedResponse = TRUE; 57 | 58 | return request; 59 | } 60 | 61 | - (ASIFormDataRequest *)formRequestWithUrl:(NSString *)url 62 | { 63 | ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:url]]; 64 | request.numberOfTimesToRetryOnTimeout = 2; 65 | request.timeOutSeconds = RequestTimeOutSeconds; 66 | [request setRequestMethod:@"POST"]; 67 | 68 | request.allowCompressedResponse = TRUE; 69 | 70 | #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0 71 | [request setShouldContinueWhenAppEntersBackground:YES]; 72 | #endif 73 | 74 | return request; 75 | } 76 | 77 | #pragma mark - 78 | #pragma mark Content Management 79 | 80 | - (void)downloadContentForUrl:(NSString *)url withObject:(id)object path:(NSString *)path notificationName:(NSString *)notificationName 81 | { 82 | NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys: 83 | path, @"path", 84 | notificationName, @"notificationName", 85 | object, @"object", 86 | nil]; 87 | 88 | ASIHTTPRequest *request = [self requestWithUrl:url]; 89 | request.userInfo = userInfo; 90 | request.delegate = self; 91 | 92 | [self.networkQueue addOperation:request]; 93 | [self.networkQueue go]; 94 | 95 | [[BaseLoadingViewCenter sharedBaseLoadingViewCenter]didStartLoadingForKey:[self notificationNameForRequest:request]]; 96 | } 97 | 98 | #pragma mark - 99 | #pragma mark ASIHTTPRequest delegate 100 | 101 | - (void)fetchStarted:(ASIHTTPRequest *)request 102 | { 103 | DLog(@"fetch started for url:%@", request.url); 104 | } 105 | 106 | - (void)fetchCompleted:(ASIHTTPRequest *)request 107 | { 108 | NSDictionary *info = request.userInfo; 109 | NSString *path = [info valueForKey:@"path"]; 110 | 111 | if ([path isEqualToString:@"blah"]) { 112 | // parseBlah 113 | } 114 | 115 | DLog(@"fetch completed for url:%@", request.originalURL); 116 | } 117 | 118 | - (void)fetchFailed:(ASIHTTPRequest *)request 119 | { 120 | DLog(@"fetch failed for url:%@ error:%@", request.originalURL, [request.error localizedDescription]); 121 | 122 | [[BaseLoadingViewCenter sharedBaseLoadingViewCenter]showErrorMsg:[request.error localizedDescription] forKey:[self notificationNameForRequest:request]]; 123 | [[BaseLoadingViewCenter sharedBaseLoadingViewCenter]didStopLoadingForKey:[self notificationNameForRequest:request]]; 124 | } 125 | 126 | - (void)queueFinished:(ASINetworkQueue *)queue 127 | { 128 | DLog(@"queue finished for service:%@", NSStringFromClass([self class])); 129 | } 130 | 131 | #pragma mark - 132 | #pragma mark Dealloc 133 | 134 | - (void)dealloc 135 | { 136 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 137 | 138 | 139 | [networkQueue release]; 140 | 141 | [super dealloc]; 142 | } 143 | 144 | 145 | @end 146 | -------------------------------------------------------------------------------- /Source/CustomToolbar.m: -------------------------------------------------------------------------------- 1 | #import "CustomToolbar.h" 2 | 3 | @interface CustomToolbar () 4 | 5 | @property (nonatomic, readonly) NSMutableDictionary *backgroundImagesDict; 6 | @property (nonatomic, readonly) NSMutableDictionary *shadowImagesDict; 7 | - (void)setupShadow; 8 | @property (nonatomic, readonly) UIImageView *shadowImageView; 9 | 10 | @end 11 | 12 | @implementation CustomToolbar 13 | 14 | @synthesize backgroundImagesDict, shadowImagesDict, shadowImageView; 15 | 16 | // The designated initializer. Override to perform setup that is required before the view is loaded. 17 | // Only when xibless (interface buildder) 18 | - (id)initWithFrame:(CGRect)frame { 19 | self = [super initWithFrame:frame]; 20 | if (self) { 21 | // Custom initialization 22 | [self setupCustomInitialisation]; 23 | } 24 | return self; 25 | } 26 | 27 | // The designated initializer. Override to perform setup that is required before the view is loaded. 28 | // Only when using xib (interface buildder) 29 | - (id)initWithCoder:(NSCoder *)decoder { 30 | self = [super initWithCoder:decoder]; 31 | if (self) { 32 | // Custom initialization 33 | [self setupCustomInitialisation]; 34 | } 35 | return self; 36 | } 37 | 38 | - (void)setupCustomInitialisation 39 | { 40 | // Initialization code 41 | self.clipsToBounds = FALSE; 42 | } 43 | 44 | #pragma mark - 45 | #pragma mark BackgroundImage 46 | 47 | - (NSMutableDictionary *)backgroundImagesDict 48 | { 49 | if (!backgroundImagesDict) { 50 | backgroundImagesDict = [[NSMutableDictionary alloc]init]; 51 | } 52 | 53 | return backgroundImagesDict; 54 | } 55 | 56 | - (UIImage *)backgroundImageForStyle:(UIBarStyle)aBarStyle 57 | { 58 | return [self.backgroundImagesDict objectForKey:[NSNumber numberWithInteger:aBarStyle]]; 59 | } 60 | 61 | - (void)setBackgroundImage:(UIImage *)backgroundImage forBarStyle:(UIBarStyle)aBarStyle; 62 | { 63 | if (backgroundImage) { 64 | [self.backgroundImagesDict setObject:backgroundImage forKey:[NSNumber numberWithInteger:aBarStyle]]; 65 | } else { 66 | [self.backgroundImagesDict removeObjectForKey:[NSNumber numberWithInteger:aBarStyle]]; 67 | } 68 | 69 | [self setNeedsDisplay]; 70 | } 71 | 72 | - (void)clearBackground 73 | { 74 | [self.backgroundImagesDict removeAllObjects]; 75 | [self setNeedsDisplay]; 76 | } 77 | 78 | #pragma mark - 79 | #pragma mark ShadowImage 80 | 81 | - (NSMutableDictionary *)shadowImagesDict 82 | { 83 | if (!shadowImagesDict) { 84 | shadowImagesDict = [[NSMutableDictionary alloc]init]; 85 | } 86 | 87 | return shadowImagesDict; 88 | } 89 | 90 | - (UIImageView *)shadowImageView 91 | { 92 | if (!shadowImageView) { 93 | shadowImageView = [[[UIImageView alloc]initWithFrame:CGRectZero]autorelease]; 94 | shadowImageView.userInteractionEnabled = FALSE; 95 | [self addSubview:shadowImageView]; 96 | } 97 | 98 | return shadowImageView; 99 | } 100 | 101 | - (UIImage *)shadowImageForStyle:(UIBarStyle)aBarStyle 102 | { 103 | return [self.shadowImagesDict objectForKey:[NSNumber numberWithInteger:aBarStyle]]; 104 | } 105 | 106 | - (void)setShadowImage:(UIImage *)shadowImage forBarStyle:(UIBarStyle)aBarStyle; 107 | { 108 | if (shadowImage) { 109 | [self.shadowImagesDict setObject:shadowImage forKey:[NSNumber numberWithInteger:aBarStyle]]; 110 | } else { 111 | [self.shadowImagesDict removeObjectForKey:[NSNumber numberWithInteger:aBarStyle]]; 112 | } 113 | 114 | [self setupShadow]; 115 | } 116 | 117 | - (void)clearShadow 118 | { 119 | [self.shadowImagesDict removeAllObjects]; 120 | [self setupShadow]; 121 | } 122 | 123 | #pragma mark - 124 | #pragma mark Drawing 125 | 126 | - (void)setupShadow 127 | { 128 | UIImage *shadowImage = [self shadowImageForStyle:self.barStyle]; 129 | if (shadowImage) { 130 | CGSize boundsSize = self.bounds.size; 131 | CGRect rect = CGRectMake(0.0, 132 | -shadowImage.size.height, 133 | boundsSize.width, 134 | shadowImage.size.height); 135 | self.shadowImageView.image = shadowImage; 136 | self.shadowImageView.frame = rect; 137 | } 138 | } 139 | 140 | - (void)drawRect:(CGRect)rect 141 | { 142 | // Drawing code. 143 | UIImage *backgroundImage = [self backgroundImageForStyle:self.barStyle]; 144 | if (backgroundImage) { 145 | [backgroundImage drawInRect:rect]; 146 | } else { 147 | [super drawRect:rect]; 148 | } 149 | } 150 | 151 | #pragma mark - 152 | #pragma mark Dealloc 153 | 154 | - (void)dealloc 155 | { 156 | [shadowImagesDict release]; 157 | [backgroundImagesDict release]; 158 | 159 | [super dealloc]; 160 | } 161 | 162 | @end 163 | -------------------------------------------------------------------------------- /Source/BaseWebViewController.m: -------------------------------------------------------------------------------- 1 | #import "BaseWebViewController.h" 2 | 3 | @interface BaseWebViewController () 4 | 5 | - (void)doneButtonTouched; 6 | - (void)backButtonTouched; 7 | - (void)forwardButtonTouched; 8 | - (void)actionButtonTouched; 9 | - (void)loadRequest; 10 | 11 | @end 12 | 13 | 14 | @implementation BaseWebViewController 15 | 16 | @synthesize webView, request; 17 | 18 | #pragma mark - 19 | #pragma mark Setup 20 | 21 | - (void)viewWillDisappear:(BOOL)animated 22 | { 23 | [[UIApplication sharedApplication]setNetworkActivityIndicatorVisible:FALSE]; 24 | } 25 | 26 | - (void)viewDidLoad 27 | { 28 | [super viewDidLoad]; 29 | 30 | self.webView.delegate = self; 31 | 32 | [self loadRequest]; 33 | } 34 | 35 | - (void)viewDidUnload { 36 | self.webView = nil; 37 | 38 | [super viewDidUnload]; 39 | } 40 | 41 | - (void)setupNavigationBar 42 | { 43 | self.navigationController.navigationBar.hidden = TRUE; 44 | } 45 | 46 | - (void)setupToolbar 47 | { 48 | self.navigationController.toolbar.barStyle = UIBarStyleBlackOpaque; 49 | self.navigationController.toolbar.translucent = FALSE; 50 | [self.navigationController setToolbarHidden:FALSE animated:FALSE]; 51 | 52 | UIBarButtonItem *flexItem = [[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace 53 | target:nil 54 | action:nil]autorelease]; 55 | 56 | UIBarButtonItem *fixItem = [[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace 57 | target:nil 58 | action:nil]autorelease]; 59 | fixItem.width = 30.0; 60 | 61 | UIBarButtonItem *backItem = [[[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"left-arrow.png"] 62 | style:UIBarButtonItemStylePlain 63 | target:self 64 | action:@selector(backButtonTouched)]autorelease]; 65 | if ([self.webView canGoBack]) { 66 | backItem.enabled = TRUE; 67 | } else { 68 | backItem.enabled = FALSE; 69 | } 70 | 71 | UIBarButtonItem *forwardItem = [[[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"right-arrow.png"] 72 | style:UIBarButtonItemStylePlain 73 | target:self 74 | action:@selector(forwardButtonTouched)]autorelease]; 75 | if ([self.webView canGoForward]) { 76 | forwardItem.enabled = TRUE; 77 | } else { 78 | forwardItem.enabled = FALSE; 79 | } 80 | 81 | UIBarButtonItem *actionItem = [[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAction 82 | target:self 83 | action:@selector(actionButtonTouched)]autorelease]; 84 | 85 | UIBarButtonItem *doneItem = [[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemDone 86 | target:self 87 | action:@selector(doneButtonTouched)]autorelease]; 88 | 89 | NSArray *items = [NSArray arrayWithObjects: 90 | flexItem, 91 | backItem, 92 | fixItem, 93 | actionItem, 94 | fixItem, 95 | forwardItem, 96 | fixItem, 97 | doneItem, 98 | nil]; 99 | [self setToolbarItems:items animated:FALSE]; 100 | } 101 | 102 | #pragma mark - 103 | #pragma mark Request 104 | 105 | - (void)loadRequest 106 | { 107 | if (self.request) { 108 | [self.webView loadRequest:self.request]; 109 | } 110 | } 111 | 112 | - (void)setRequest:(NSURLRequest *)aRequest 113 | { 114 | if (![request isEqual:aRequest]) { 115 | [request release]; 116 | request = [aRequest retain]; 117 | } 118 | } 119 | 120 | #pragma mark - 121 | #pragma mark WebView Delegate 122 | 123 | - (void)webViewDidStartLoad:(UIWebView *)webView 124 | { 125 | // Show the netowrk activity indicator while operation is doing something 126 | [[UIApplication sharedApplication]setNetworkActivityIndicatorVisible:TRUE]; 127 | } 128 | 129 | - (void)webViewDidFinishLoad:(UIWebView *)webView 130 | { 131 | [self setupToolbar]; 132 | 133 | // Show the netowrk activity indicator while operation is doing something 134 | [[UIApplication sharedApplication]setNetworkActivityIndicatorVisible:FALSE]; 135 | } 136 | 137 | - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error 138 | { 139 | [self setupToolbar]; 140 | 141 | // Show the netowrk activity indicator while operation is doing something 142 | [[UIApplication sharedApplication]setNetworkActivityIndicatorVisible:FALSE]; 143 | } 144 | 145 | #pragma mark - 146 | #pragma mark Action 147 | 148 | - (void)doneButtonTouched 149 | { 150 | [self dismissModalViewControllerAnimated:TRUE]; 151 | } 152 | 153 | - (void)backButtonTouched 154 | { 155 | if ([self.webView canGoBack]) { 156 | [self.webView goBack]; 157 | } 158 | } 159 | 160 | - (void)forwardButtonTouched 161 | { 162 | if ([self.webView canGoForward]) { 163 | [self.webView goForward]; 164 | } 165 | } 166 | 167 | - (void)actionButtonTouched 168 | { 169 | UIActionSheet *alertSheet = 170 | [[UIActionSheet alloc] initWithTitle:nil 171 | delegate:self 172 | cancelButtonTitle:@"Cancel" 173 | destructiveButtonTitle:nil 174 | otherButtonTitles:@"Open in Safari", nil]; 175 | 176 | alertSheet.actionSheetStyle = UIActionSheetStyleBlackTranslucent; 177 | [alertSheet showInView:self.view]; 178 | [alertSheet release]; 179 | } 180 | 181 | #pragma mark - 182 | #pragma mark actionSheet 183 | 184 | // change the navigation bar style, also make the status bar match with it 185 | - (void)actionSheet:(UIActionSheet *)modalView clickedButtonAtIndex:(NSInteger)buttonIndex 186 | { 187 | NSString *title = [modalView buttonTitleAtIndex:buttonIndex]; 188 | 189 | if ([title isEqualToString:@"Open in Safari"]) { 190 | if (![[UIApplication sharedApplication]openURL:self.webView.request.URL]) { 191 | [[UIApplication sharedApplication]openURL:self.request.URL]; 192 | } 193 | } 194 | } 195 | 196 | #pragma mark - 197 | #pragma mark Dealloc 198 | 199 | - (void)dealloc 200 | { 201 | [request release]; 202 | [webView release]; 203 | 204 | [super dealloc]; 205 | } 206 | 207 | 208 | @end 209 | -------------------------------------------------------------------------------- /Source/BaseViewController.m: -------------------------------------------------------------------------------- 1 | #import "BaseViewController.h" 2 | #import "MyLocationGetter.h" 3 | 4 | @implementation BaseViewController 5 | 6 | @synthesize loadingView, noResultsView; 7 | 8 | #pragma mark - 9 | #pragma mark Initialisation 10 | 11 | // The designated initializer. Override to perform setup that is required before the view is loaded. 12 | // Only when xibless (interface buildder) 13 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 14 | { 15 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 16 | if (self) { 17 | // Custom initialization 18 | [self setupCustomInitialisation]; 19 | } 20 | return self; 21 | } 22 | 23 | // The designated initializer. Override to perform setup that is required before the view is loaded. 24 | // Only when using xib (interface buildder) 25 | - (id)initWithCoder:(NSCoder *)decoder 26 | { 27 | self = [super initWithCoder:decoder]; 28 | if (self) { 29 | // Custom initialization 30 | [self setupCustomInitialisation]; 31 | } 32 | return self; 33 | } 34 | 35 | - (void)setupCustomInitialisation 36 | { 37 | 38 | } 39 | 40 | - (void)viewDidLoad 41 | { 42 | [super viewDidLoad]; 43 | 44 | [self setupNavigationBar]; 45 | [self setupToolbar]; 46 | 47 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(locationDidFix) name:GPSLocationDidFix object:nil]; 48 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(locationDidStop) name:GPSLocationDidStop object:nil]; 49 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive) name:UIApplicationDidBecomeActiveNotification object:nil]; 50 | } 51 | 52 | - (void)setTitle:(NSString *)aTitle 53 | { 54 | [super setTitle:aTitle]; 55 | 56 | if ([self.navigationItem.titleView respondsToSelector:@selector(setText:)]) { 57 | [self.navigationItem.titleView performSelector:@selector(setText:) withObject:aTitle]; 58 | if ([self.navigationItem.titleView respondsToSelector:@selector(sizeToFit)]) { 59 | [self.navigationItem.titleView performSelector:@selector(sizeToFit)]; 60 | } 61 | 62 | } 63 | } 64 | 65 | #pragma mark - 66 | #pragma mark Setup 67 | 68 | - (void)setupNavigationBar 69 | { 70 | 71 | } 72 | 73 | - (void)setupToolbar 74 | { 75 | 76 | } 77 | 78 | #pragma mark - 79 | #pragma mark Content reloading 80 | 81 | - (void)shouldReloadContent:(NSNotification *)notification 82 | { 83 | 84 | } 85 | 86 | #pragma mark - 87 | #pragma mark BaseLoadingViewCenter Delegate 88 | 89 | - (void)baseLoadingViewCenterDidStartForKey:(NSString *)key 90 | { 91 | [self.noResultsView hide:FALSE]; 92 | 93 | if (!self.loadingView) { 94 | self.loadingView = [[[MBProgressHUD alloc] initWithView:self.view]autorelease]; 95 | self.loadingView.delegate = self; 96 | [self.view addSubview:self.loadingView]; 97 | [self.view bringSubviewToFront:self.loadingView]; 98 | [self.loadingView show:TRUE]; 99 | } 100 | self.loadingView.labelText = @"Loading"; 101 | } 102 | 103 | - (void)baseLoadingViewCenterDidStopForKey:(NSString *)key 104 | { 105 | [self.loadingView hide:TRUE]; 106 | } 107 | 108 | - (void)baseLoadingViewCenterShowErrorMsg:(NSString *)errorMsg forKey:(NSString *)key; 109 | { 110 | [self.loadingView hide:FALSE]; 111 | 112 | if (!self.noResultsView) { 113 | self.noResultsView = [[[MBProgressHUD alloc] initWithView:self.view]autorelease]; 114 | self.noResultsView.customView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@""]] autorelease]; 115 | self.noResultsView.labelText = errorMsg; 116 | self.noResultsView.mode = MBProgressHUDModeCustomView; 117 | self.noResultsView.delegate = self; 118 | [self.view addSubview:self.noResultsView]; 119 | [self.view bringSubviewToFront:self.noResultsView]; 120 | [self.noResultsView show:TRUE]; 121 | [self performSelector:@selector(baseLoadingViewCenterRemoveErrorMsgForKey:) withObject:key afterDelay:1.5]; 122 | } 123 | } 124 | 125 | - (void)baseLoadingViewCenterShowErrorMsg:(NSString *)errorMsg details:(NSString *)details forKey:(NSString *)key 126 | { 127 | [self.loadingView hide:FALSE]; 128 | 129 | if (!self.noResultsView) { 130 | self.noResultsView = [[[MBProgressHUD alloc] initWithView:self.view]autorelease]; 131 | self.noResultsView.customView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@""]] autorelease]; 132 | self.noResultsView.labelText = errorMsg; 133 | self.noResultsView.detailsLabelText = details; 134 | self.noResultsView.mode = MBProgressHUDModeCustomView; 135 | self.noResultsView.delegate = self; 136 | [self.view addSubview:self.noResultsView]; 137 | [self.view bringSubviewToFront:self.noResultsView]; 138 | [self.noResultsView show:TRUE]; 139 | [self performSelector:@selector(baseLoadingViewCenterRemoveErrorMsgForKey:) withObject:key afterDelay:1.5]; 140 | } 141 | } 142 | 143 | - (void)baseLoadingViewCenterRemoveErrorMsgForKey:(NSString *)key 144 | { 145 | [self.noResultsView hide:TRUE]; 146 | } 147 | 148 | #pragma mark - 149 | #pragma mark MBProgressHUDDelegate methods 150 | 151 | - (void)hudWasHidden:(MBProgressHUD *)hud 152 | { 153 | if (hud == self.loadingView) { 154 | [self.loadingView removeFromSuperview]; 155 | self.loadingView = nil; 156 | } else if (hud == self.noResultsView) { 157 | [self.noResultsView removeFromSuperview]; 158 | self.noResultsView = nil; 159 | } 160 | } 161 | 162 | #pragma mark - 163 | #pragma mark Core Location 164 | 165 | - (void)locationDidFix 166 | { 167 | 168 | } 169 | 170 | - (void)locationDidStop 171 | { 172 | 173 | } 174 | 175 | #pragma mark - 176 | #pragma mark ResumeFromBackgrounding 177 | 178 | - (void)applicationDidBecomeActive 179 | { 180 | 181 | } 182 | 183 | #pragma mark - 184 | #pragma mark Memory 185 | 186 | - (void)didReceiveMemoryWarning { 187 | // Releases the view if it doesn't have a superview. 188 | [super didReceiveMemoryWarning]; 189 | 190 | // Release any cached data, images, etc that aren't in use. 191 | } 192 | 193 | - (void)viewDidUnload { 194 | // Release any retained subviews of the main view. 195 | // e.g. self.myOutlet = nil; 196 | } 197 | 198 | #pragma mark - 199 | #pragma mark Rotation Support 200 | 201 | // Override to allow orientations other than the default portrait orientation. 202 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 203 | return UIInterfaceOrientationIsPortrait(interfaceOrientation); 204 | } 205 | 206 | - (void)dealloc 207 | { 208 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 209 | 210 | noResultsView.delegate = nil; 211 | [noResultsView release]; 212 | loadingView.delegate = nil; 213 | [loadingView release]; 214 | 215 | [super dealloc]; 216 | } 217 | 218 | @end 219 | -------------------------------------------------------------------------------- /resources/BaseWebView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 10H542 6 | 823 7 | 1038.35 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 132 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | 42 | 274 43 | 44 | YES 45 | 46 | 47 | 274 48 | {320, 416} 49 | 50 | 51 | 1 52 | MSAxIDEAA 53 | 54 | IBCocoaTouchFramework 55 | YES 56 | 1 57 | YES 58 | 59 | 60 | {320, 416} 61 | 62 | 63 | 3 64 | MQA 65 | 66 | 67 | 68 | NO 69 | 70 | IBCocoaTouchFramework 71 | 72 | 73 | 74 | 75 | YES 76 | 77 | 78 | view 79 | 80 | 81 | 82 | 4 83 | 84 | 85 | 86 | webView 87 | 88 | 89 | 90 | 5 91 | 92 | 93 | 94 | delegate 95 | 96 | 97 | 98 | 7 99 | 100 | 101 | 102 | 103 | YES 104 | 105 | 0 106 | 107 | 108 | 109 | 110 | 111 | 1 112 | 113 | 114 | YES 115 | 116 | 117 | 118 | 119 | 120 | -1 121 | 122 | 123 | File's Owner 124 | 125 | 126 | -2 127 | 128 | 129 | 130 | 131 | 3 132 | 133 | 134 | 135 | 136 | 137 | 138 | YES 139 | 140 | YES 141 | -1.CustomClassName 142 | -2.CustomClassName 143 | 1.IBEditorWindowLastContentRect 144 | 1.IBPluginDependency 145 | 3.IBPluginDependency 146 | 147 | 148 | YES 149 | BaseWebViewController 150 | UIResponder 151 | {{354, 376}, {320, 480}} 152 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 153 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 154 | 155 | 156 | 157 | YES 158 | 159 | 160 | YES 161 | 162 | 163 | 164 | 165 | YES 166 | 167 | 168 | YES 169 | 170 | 171 | 172 | 7 173 | 174 | 175 | 176 | YES 177 | 178 | BaseViewController 179 | UIViewController 180 | 181 | IBProjectSource 182 | Source/Main/Views/BaseViewController.h 183 | 184 | 185 | 186 | BaseWebViewController 187 | BaseViewController 188 | 189 | webView 190 | UIWebView 191 | 192 | 193 | webView 194 | 195 | webView 196 | UIWebView 197 | 198 | 199 | 200 | IBProjectSource 201 | Source/Main/Views/BaseWebViewController.h 202 | 203 | 204 | 205 | NSObject 206 | 207 | IBProjectSource 208 | Source/External/json-framework/Classes/NSObject+SBJSON.h 209 | 210 | 211 | 212 | NSObject 213 | 214 | IBProjectSource 215 | Source/External/json-framework/Classes/SBProxyForJson.h 216 | 217 | 218 | 219 | NSObject 220 | 221 | IBProjectSource 222 | Source/Main/Utilities/NSObject+Extensions.h 223 | 224 | 225 | 226 | 227 | YES 228 | 229 | NSObject 230 | 231 | IBFrameworkSource 232 | Foundation.framework/Headers/NSError.h 233 | 234 | 235 | 236 | NSObject 237 | 238 | IBFrameworkSource 239 | Foundation.framework/Headers/NSFileManager.h 240 | 241 | 242 | 243 | NSObject 244 | 245 | IBFrameworkSource 246 | Foundation.framework/Headers/NSKeyValueCoding.h 247 | 248 | 249 | 250 | NSObject 251 | 252 | IBFrameworkSource 253 | Foundation.framework/Headers/NSKeyValueObserving.h 254 | 255 | 256 | 257 | NSObject 258 | 259 | IBFrameworkSource 260 | Foundation.framework/Headers/NSKeyedArchiver.h 261 | 262 | 263 | 264 | NSObject 265 | 266 | IBFrameworkSource 267 | Foundation.framework/Headers/NSObject.h 268 | 269 | 270 | 271 | NSObject 272 | 273 | IBFrameworkSource 274 | Foundation.framework/Headers/NSRunLoop.h 275 | 276 | 277 | 278 | NSObject 279 | 280 | IBFrameworkSource 281 | Foundation.framework/Headers/NSThread.h 282 | 283 | 284 | 285 | NSObject 286 | 287 | IBFrameworkSource 288 | Foundation.framework/Headers/NSURL.h 289 | 290 | 291 | 292 | NSObject 293 | 294 | IBFrameworkSource 295 | Foundation.framework/Headers/NSURLConnection.h 296 | 297 | 298 | 299 | NSObject 300 | 301 | IBFrameworkSource 302 | QuartzCore.framework/Headers/CAAnimation.h 303 | 304 | 305 | 306 | NSObject 307 | 308 | IBFrameworkSource 309 | QuartzCore.framework/Headers/CALayer.h 310 | 311 | 312 | 313 | NSObject 314 | 315 | IBFrameworkSource 316 | UIKit.framework/Headers/UIAccessibility.h 317 | 318 | 319 | 320 | NSObject 321 | 322 | IBFrameworkSource 323 | UIKit.framework/Headers/UINibLoading.h 324 | 325 | 326 | 327 | NSObject 328 | 329 | IBFrameworkSource 330 | UIKit.framework/Headers/UIResponder.h 331 | 332 | 333 | 334 | UIResponder 335 | NSObject 336 | 337 | 338 | 339 | UISearchBar 340 | UIView 341 | 342 | IBFrameworkSource 343 | UIKit.framework/Headers/UISearchBar.h 344 | 345 | 346 | 347 | UISearchDisplayController 348 | NSObject 349 | 350 | IBFrameworkSource 351 | UIKit.framework/Headers/UISearchDisplayController.h 352 | 353 | 354 | 355 | UIView 356 | 357 | IBFrameworkSource 358 | UIKit.framework/Headers/UIPrintFormatter.h 359 | 360 | 361 | 362 | UIView 363 | 364 | IBFrameworkSource 365 | UIKit.framework/Headers/UITextField.h 366 | 367 | 368 | 369 | UIView 370 | UIResponder 371 | 372 | IBFrameworkSource 373 | UIKit.framework/Headers/UIView.h 374 | 375 | 376 | 377 | UIViewController 378 | 379 | IBFrameworkSource 380 | MediaPlayer.framework/Headers/MPMoviePlayerViewController.h 381 | 382 | 383 | 384 | UIViewController 385 | 386 | IBFrameworkSource 387 | UIKit.framework/Headers/UINavigationController.h 388 | 389 | 390 | 391 | UIViewController 392 | 393 | IBFrameworkSource 394 | UIKit.framework/Headers/UIPopoverController.h 395 | 396 | 397 | 398 | UIViewController 399 | 400 | IBFrameworkSource 401 | UIKit.framework/Headers/UISplitViewController.h 402 | 403 | 404 | 405 | UIViewController 406 | 407 | IBFrameworkSource 408 | UIKit.framework/Headers/UITabBarController.h 409 | 410 | 411 | 412 | UIViewController 413 | UIResponder 414 | 415 | IBFrameworkSource 416 | UIKit.framework/Headers/UIViewController.h 417 | 418 | 419 | 420 | UIWebView 421 | UIView 422 | 423 | IBFrameworkSource 424 | UIKit.framework/Headers/UIWebView.h 425 | 426 | 427 | 428 | 429 | 0 430 | IBCocoaTouchFramework 431 | 432 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 433 | 434 | 435 | 436 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 437 | 438 | 439 | YES 440 | ../Hotspot.xcodeproj 441 | 3 442 | 132 443 | 444 | 445 | -------------------------------------------------------------------------------- /resources/CustomNavigationController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 10J567 6 | 823 7 | 1038.35 8 | 462.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 132 12 | 13 | 14 | YES 15 | 16 | 17 | YES 18 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 19 | 20 | 21 | YES 22 | 23 | YES 24 | 25 | 26 | YES 27 | 28 | 29 | 30 | YES 31 | 32 | IBFilesOwner 33 | IBCocoaTouchFramework 34 | 35 | 36 | IBFirstResponder 37 | IBCocoaTouchFramework 38 | 39 | 40 | 41 | 42 | 1 43 | 44 | IBCocoaTouchFramework 45 | NO 46 | 47 | 48 | 256 49 | {0, 0} 50 | NO 51 | YES 52 | YES 53 | IBCocoaTouchFramework 54 | 55 | 56 | 57 | 256 58 | {{0, 436}, {320, 44}} 59 | NO 60 | YES 61 | 4 62 | YES 63 | IBCocoaTouchFramework 64 | 65 | 66 | YES 67 | 68 | 69 | Root View Controller 70 | IBCocoaTouchFramework 71 | 72 | 73 | 74 | 1 75 | 76 | IBCocoaTouchFramework 77 | NO 78 | 79 | 80 | 81 | 82 | 83 | 84 | YES 85 | 86 | 87 | 88 | YES 89 | 90 | 0 91 | 92 | 93 | 94 | 95 | 96 | -1 97 | 98 | 99 | File's Owner 100 | 101 | 102 | -2 103 | 104 | 105 | 106 | 107 | 2 108 | 109 | 110 | YES 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 3 119 | 120 | 121 | YES 122 | 123 | 124 | 125 | 126 | 127 | 4 128 | 129 | 130 | 131 | 132 | 5 133 | 134 | 135 | 136 | 137 | 7 138 | 139 | 140 | 141 | 142 | 143 | 144 | YES 145 | 146 | YES 147 | -2.CustomClassName 148 | 2.IBEditorWindowLastContentRect 149 | 2.IBPluginDependency 150 | 3.IBPluginDependency 151 | 4.CustomClassName 152 | 4.IBPluginDependency 153 | 5.IBPluginDependency 154 | 7.CustomClassName 155 | 156 | 157 | YES 158 | UIResponder 159 | {{21, 331}, {320, 480}} 160 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 161 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 162 | CustomNavigationBar 163 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 164 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 165 | CustomToolbar 166 | 167 | 168 | 169 | YES 170 | 171 | 172 | YES 173 | 174 | 175 | 176 | 177 | YES 178 | 179 | 180 | YES 181 | 182 | 183 | 184 | 7 185 | 186 | 187 | 188 | YES 189 | 190 | CustomNavigationBar 191 | UINavigationBar 192 | 193 | IBProjectSource 194 | Source/External/ObjectiveDump3/Source/Main/Views/CustomNavigationBar.h 195 | 196 | 197 | 198 | CustomToolbar 199 | UIToolbar 200 | 201 | IBUserSource 202 | 203 | 204 | 205 | 206 | NSObject 207 | 208 | IBProjectSource 209 | Source/External/ObjectiveDump3/Source/External/json-framework/Classes/SBJsonStreamWriter.h 210 | 211 | 212 | 213 | NSObject 214 | 215 | IBProjectSource 216 | Source/External/ObjectiveDump3/Source/External/objectivesupport/Classes/lib/Core/NSObject+PropertySupport.h 217 | 218 | 219 | 220 | NSObject 221 | 222 | IBProjectSource 223 | Source/External/ObjectiveDump3/Source/External/objectivesupport/Classes/lib/Serialization/JSON/NSObject+JSONSerializableSupport.h 224 | 225 | 226 | 227 | NSObject 228 | 229 | IBProjectSource 230 | Source/External/ObjectiveDump3/Source/External/objectivesupport/Classes/lib/Serialization/NSObject+Serialize.h 231 | 232 | 233 | 234 | NSObject 235 | 236 | IBProjectSource 237 | Source/External/ObjectiveDump3/Source/Main/Utilities/NSObject+Extensions.h 238 | 239 | 240 | 241 | UINavigationController 242 | 243 | IBProjectSource 244 | Source/External/ObjectiveDump3/Source/Main/Views/UINavigationController+CustomNavigationBar.h 245 | 246 | 247 | 248 | 249 | YES 250 | 251 | NSObject 252 | 253 | IBFrameworkSource 254 | Foundation.framework/Headers/NSError.h 255 | 256 | 257 | 258 | NSObject 259 | 260 | IBFrameworkSource 261 | Foundation.framework/Headers/NSFileManager.h 262 | 263 | 264 | 265 | NSObject 266 | 267 | IBFrameworkSource 268 | Foundation.framework/Headers/NSKeyValueCoding.h 269 | 270 | 271 | 272 | NSObject 273 | 274 | IBFrameworkSource 275 | Foundation.framework/Headers/NSKeyValueObserving.h 276 | 277 | 278 | 279 | NSObject 280 | 281 | IBFrameworkSource 282 | Foundation.framework/Headers/NSKeyedArchiver.h 283 | 284 | 285 | 286 | NSObject 287 | 288 | IBFrameworkSource 289 | Foundation.framework/Headers/NSObject.h 290 | 291 | 292 | 293 | NSObject 294 | 295 | IBFrameworkSource 296 | Foundation.framework/Headers/NSRunLoop.h 297 | 298 | 299 | 300 | NSObject 301 | 302 | IBFrameworkSource 303 | Foundation.framework/Headers/NSThread.h 304 | 305 | 306 | 307 | NSObject 308 | 309 | IBFrameworkSource 310 | Foundation.framework/Headers/NSURL.h 311 | 312 | 313 | 314 | NSObject 315 | 316 | IBFrameworkSource 317 | Foundation.framework/Headers/NSURLConnection.h 318 | 319 | 320 | 321 | NSObject 322 | 323 | IBFrameworkSource 324 | QuartzCore.framework/Headers/CAAnimation.h 325 | 326 | 327 | 328 | NSObject 329 | 330 | IBFrameworkSource 331 | QuartzCore.framework/Headers/CALayer.h 332 | 333 | 334 | 335 | NSObject 336 | 337 | IBFrameworkSource 338 | UIKit.framework/Headers/UIAccessibility.h 339 | 340 | 341 | 342 | NSObject 343 | 344 | IBFrameworkSource 345 | UIKit.framework/Headers/UINibLoading.h 346 | 347 | 348 | 349 | NSObject 350 | 351 | IBFrameworkSource 352 | UIKit.framework/Headers/UIResponder.h 353 | 354 | 355 | 356 | UIBarButtonItem 357 | UIBarItem 358 | 359 | IBFrameworkSource 360 | UIKit.framework/Headers/UIBarButtonItem.h 361 | 362 | 363 | 364 | UIBarItem 365 | NSObject 366 | 367 | IBFrameworkSource 368 | UIKit.framework/Headers/UIBarItem.h 369 | 370 | 371 | 372 | UINavigationBar 373 | UIView 374 | 375 | IBFrameworkSource 376 | UIKit.framework/Headers/UINavigationBar.h 377 | 378 | 379 | 380 | UINavigationController 381 | UIViewController 382 | 383 | IBFrameworkSource 384 | UIKit.framework/Headers/UINavigationController.h 385 | 386 | 387 | 388 | UINavigationItem 389 | NSObject 390 | 391 | 392 | 393 | UIResponder 394 | NSObject 395 | 396 | 397 | 398 | UISearchBar 399 | UIView 400 | 401 | IBFrameworkSource 402 | UIKit.framework/Headers/UISearchBar.h 403 | 404 | 405 | 406 | UISearchDisplayController 407 | NSObject 408 | 409 | IBFrameworkSource 410 | UIKit.framework/Headers/UISearchDisplayController.h 411 | 412 | 413 | 414 | UIToolbar 415 | UIView 416 | 417 | IBFrameworkSource 418 | UIKit.framework/Headers/UIToolbar.h 419 | 420 | 421 | 422 | UIView 423 | 424 | IBFrameworkSource 425 | UIKit.framework/Headers/UIPrintFormatter.h 426 | 427 | 428 | 429 | UIView 430 | 431 | IBFrameworkSource 432 | UIKit.framework/Headers/UITextField.h 433 | 434 | 435 | 436 | UIView 437 | UIResponder 438 | 439 | IBFrameworkSource 440 | UIKit.framework/Headers/UIView.h 441 | 442 | 443 | 444 | UIViewController 445 | 446 | 447 | 448 | UIViewController 449 | 450 | IBFrameworkSource 451 | UIKit.framework/Headers/UIPopoverController.h 452 | 453 | 454 | 455 | UIViewController 456 | 457 | IBFrameworkSource 458 | UIKit.framework/Headers/UISplitViewController.h 459 | 460 | 461 | 462 | UIViewController 463 | 464 | IBFrameworkSource 465 | UIKit.framework/Headers/UITabBarController.h 466 | 467 | 468 | 469 | UIViewController 470 | UIResponder 471 | 472 | IBFrameworkSource 473 | UIKit.framework/Headers/UIViewController.h 474 | 475 | 476 | 477 | 478 | 0 479 | IBCocoaTouchFramework 480 | 481 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 482 | 483 | 484 | 485 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 486 | 487 | 488 | YES 489 | ../../../../../../ContextDo.xcodeproj 490 | 3 491 | 132 492 | 493 | 494 | --------------------------------------------------------------------------------