From 44d483b7fe4bf8b40997641d40e1dc8281a66f5b Mon Sep 17 00:00:00 2001 From: Hannah Troisi Date: Sun, 10 Apr 2016 23:34:41 -0700 Subject: [PATCH] [New Example] 500pxgram updates - addressed all comments in PR except autolayout of UIKit code --- .../ASDKgram/Sample.xcodeproj/project.pbxproj | 14 ++++- examples/ASDKgram/Sample/AppDelegate.h | 7 +-- examples/ASDKgram/Sample/AppDelegate.m | 62 ++++--------------- examples/ASDKgram/Sample/CommentFeedModel.h | 1 - examples/ASDKgram/Sample/CommentFeedModel.m | 7 ++- examples/ASDKgram/Sample/CommentModel.h | 3 - examples/ASDKgram/Sample/CommentView.h | 1 - examples/ASDKgram/Sample/ImageURLModel.h | 3 - examples/ASDKgram/Sample/Info.plist | 2 + examples/ASDKgram/Sample/LocationModel.h | 1 - examples/ASDKgram/Sample/LocationModel.m | 1 - examples/ASDKgram/Sample/PhotoCellNode.h | 1 - .../ASDKgram/Sample/PhotoCollectionViewCell.h | 1 - examples/ASDKgram/Sample/PhotoFeedModel.h | 1 - .../ASDKgram/Sample/PhotoFeedNodeController.h | 2 +- .../ASDKgram/Sample/PhotoFeedNodeController.m | 1 - .../ASDKgram/Sample/PhotoFeedViewController.h | 3 +- .../ASDKgram/Sample/PhotoFeedViewController.m | 1 - examples/ASDKgram/Sample/PhotoModel.h | 1 - examples/ASDKgram/Sample/PhotoModel.m | 2 - examples/ASDKgram/Sample/PhotoTableViewCell.h | 1 - .../Sample/{Flickrgram.pch => Sample.pch} | 4 +- examples/ASDKgram/Sample/UserModel.h | 3 - examples/ASDKgram/Sample/UserModel.m | 1 - examples/ASDKgram/Sample/Utilities.h | 3 - examples/ASDKgram/Sample/Utilities.m | 1 - .../Sample/WindowWithStatusBarUnderlay.h | 11 ++++ .../Sample/WindowWithStatusBarUnderlay.m | 40 ++++++++++++ examples/ASDKgram/Sample/main.m | 1 - 29 files changed, 86 insertions(+), 94 deletions(-) rename examples/ASDKgram/Sample/{Flickrgram.pch => Sample.pch} (51%) create mode 100644 examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.h create mode 100644 examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.m diff --git a/examples/ASDKgram/Sample.xcodeproj/project.pbxproj b/examples/ASDKgram/Sample.xcodeproj/project.pbxproj index 041c4dc8..b9241d31 100644 --- a/examples/ASDKgram/Sample.xcodeproj/project.pbxproj +++ b/examples/ASDKgram/Sample.xcodeproj/project.pbxproj @@ -11,6 +11,7 @@ 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */; }; 6C2C82AC19EE274300767484 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AA19EE274300767484 /* Default-667h@2x.png */; }; 6C2C82AD19EE274300767484 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AB19EE274300767484 /* Default-736h@3x.png */; }; + 76229A781CBB79E000B62CEF /* WindowWithStatusBarUnderlay.m in Sources */ = {isa = PBXBuildFile; fileRef = 76229A771CBB79E000B62CEF /* WindowWithStatusBarUnderlay.m */; }; 767A5F111CAA3BFE004CDA8D /* tabBarIcons in Resources */ = {isa = PBXBuildFile; fileRef = 767A5F101CAA3BFE004CDA8D /* tabBarIcons */; }; 767A5F131CAA3C66004CDA8D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 767A5F121CAA3C66004CDA8D /* Assets.xcassets */; }; 768843801CAA37EF00D8629E /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 768843681CAA37EF00D8629E /* AppDelegate.m */; }; @@ -39,6 +40,8 @@ 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 6C2C82AA19EE274300767484 /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = SOURCE_ROOT; }; 6C2C82AB19EE274300767484 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = SOURCE_ROOT; }; + 76229A761CBB79E000B62CEF /* WindowWithStatusBarUnderlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowWithStatusBarUnderlay.h; sourceTree = ""; }; + 76229A771CBB79E000B62CEF /* WindowWithStatusBarUnderlay.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WindowWithStatusBarUnderlay.m; sourceTree = ""; }; 767A5F101CAA3BFE004CDA8D /* tabBarIcons */ = {isa = PBXFileReference; lastKnownFileType = folder; path = tabBarIcons; sourceTree = ""; }; 767A5F121CAA3C66004CDA8D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 768843511CAA37EF00D8629E /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = AppDelegate.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; @@ -57,7 +60,7 @@ 768843621CAA37EF00D8629E /* PhotoFeedViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = PhotoFeedViewController.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 768843631CAA37EF00D8629E /* UserModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = UserModel.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 768843661CAA37EF00D8629E /* Utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = Utilities.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - 768843671CAA37EF00D8629E /* Flickrgram.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = Flickrgram.pch; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 768843671CAA37EF00D8629E /* Sample.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = Sample.pch; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 768843681CAA37EF00D8629E /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = AppDelegate.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 768843691CAA37EF00D8629E /* CommentFeedModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CommentFeedModel.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 7688436A1CAA37EF00D8629E /* CommentModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CommentModel.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; @@ -117,6 +120,8 @@ children = ( 768843511CAA37EF00D8629E /* AppDelegate.h */, 768843681CAA37EF00D8629E /* AppDelegate.m */, + 76229A761CBB79E000B62CEF /* WindowWithStatusBarUnderlay.h */, + 76229A771CBB79E000B62CEF /* WindowWithStatusBarUnderlay.m */, 767A5F141CAA3D8A004CDA8D /* Controller */, 767A5F181CAA3DB0004CDA8D /* View */, 767A5F171CAA3DA1004CDA8D /* Model */, @@ -128,7 +133,7 @@ 05E2128419D4DB510098F589 /* Supporting Files */ = { isa = PBXGroup; children = ( - 768843671CAA37EF00D8629E /* Flickrgram.pch */, + 768843671CAA37EF00D8629E /* Sample.pch */, 7688437F1CAA37EF00D8629E /* Info.plist */, 768843711CAA37EF00D8629E /* main.m */, 767A5F121CAA3C66004CDA8D /* Assets.xcassets */, @@ -367,6 +372,7 @@ 768843891CAA37EF00D8629E /* main.m in Sources */, 7688438C1CAA37EF00D8629E /* PhotoCollectionViewCell.m in Sources */, 768843921CAA37EF00D8629E /* PhotoFeedViewController.m in Sources */, + 76229A781CBB79E000B62CEF /* WindowWithStatusBarUnderlay.m in Sources */, 768843821CAA37EF00D8629E /* CommentModel.m in Sources */, 768843831CAA37EF00D8629E /* CommentsNode.m in Sources */, 768843961CAA37EF00D8629E /* Utilities.m in Sources */, @@ -471,6 +477,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Sample/Sample.pch; INFOPLIST_FILE = Sample/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -488,6 +496,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Sample/Sample.pch; INFOPLIST_FILE = Sample/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; diff --git a/examples/ASDKgram/Sample/AppDelegate.h b/examples/ASDKgram/Sample/AppDelegate.h index 4c8216cd..5c687c3f 100644 --- a/examples/ASDKgram/Sample/AppDelegate.h +++ b/examples/ASDKgram/Sample/AppDelegate.h @@ -6,16 +6,11 @@ // Copyright © 2016 Hannah Troisi. All rights reserved. // -#import - -@protocol PhotoFeedViewControllerProtocol +@protocol PhotoFeedControllerProtocol - (void)resetAllData; @end @interface AppDelegate : UIResponder -@property (strong, nonatomic) UIWindow *window; -@property (strong, nonatomic) UIView *statusBarOpaqueUnderlayView; - @end diff --git a/examples/ASDKgram/Sample/AppDelegate.m b/examples/ASDKgram/Sample/AppDelegate.m index 294e468e..3ca5ff44 100644 --- a/examples/ASDKgram/Sample/AppDelegate.m +++ b/examples/ASDKgram/Sample/AppDelegate.m @@ -9,17 +9,21 @@ #import "AppDelegate.h" #import "PhotoFeedViewController.h" #import "PhotoFeedNodeController.h" +#import "WindowWithStatusBarUnderlay.h" #import "Utilities.h" @interface AppDelegate () @end @implementation AppDelegate +{ + WindowWithStatusBarUnderlay *_window; +} - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - self.window.backgroundColor = [UIColor whiteColor]; + _window = [[WindowWithStatusBarUnderlay alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + _window.backgroundColor = [UIColor whiteColor]; // UIKit Home Feed viewController & navController PhotoFeedNodeController *asdkHomeFeedVC = [[PhotoFeedNodeController alloc] init]; @@ -50,20 +54,13 @@ uikitHomeFeedNavCtrl.navigationBar.barStyle = UIBarStyleBlack; asdkHomeFeedNavCtrl.navigationBar.barStyle = UIBarStyleBlack; - self.window.rootViewController = tabBarController; - [self.window makeKeyAndVisible]; + _window.rootViewController = tabBarController; + [_window makeKeyAndVisible]; + + // iOS8 hides the status bar in landscape orientation, this forces the status bar hidden status to NO + [application setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone]; + [application setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone]; - // opaque status bar background - self.statusBarOpaqueUnderlayView = [[UIView alloc] init]; - self.statusBarOpaqueUnderlayView.backgroundColor = [UIColor darkBlueColor]; - self.statusBarOpaqueUnderlayView.frame = [[UIApplication sharedApplication] statusBarFrame]; - if ( ![[UIApplication sharedApplication] isStatusBarHidden] ) { - [[[UIApplication sharedApplication] keyWindow] addSubview:self.statusBarOpaqueUnderlayView]; - } - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(handleDidChangeStatusBarOrientationNotification:) - name:UIApplicationWillChangeStatusBarOrientationNotification - object:nil]; return YES; } @@ -73,44 +70,11 @@ if ([viewController isKindOfClass:[UINavigationController class]]) { NSArray *viewControllers = [(UINavigationController *)viewController viewControllers]; UIViewController *rootViewController = viewControllers[0]; - if ([rootViewController conformsToProtocol:@protocol(PhotoFeedViewControllerProtocol)]) { + if ([rootViewController conformsToProtocol:@protocol(PhotoFeedControllerProtocol)]) { // FIXME: the dataModel does not currently handle clearing data during loading properly // [(id )rootViewController resetAllData]; } } } -- (void)handleDidChangeStatusBarOrientationNotification:(NSNotification *)notification; -{ - NSNumber *newOrientation = [notification.userInfo objectForKey: UIApplicationStatusBarOrientationUserInfoKey]; - NSInteger newOrientationInt = [newOrientation integerValue]; - if (UIInterfaceOrientationIsLandscape(newOrientationInt)) { - [self.statusBarOpaqueUnderlayView removeFromSuperview]; - } else { - [[[UIApplication sharedApplication] keyWindow] addSubview:self.statusBarOpaqueUnderlayView]; - } -} - -- (void)applicationWillResignActive:(UIApplication *)application { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. -} - -- (void)applicationWillTerminate:(UIApplication *)application { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. -} - @end diff --git a/examples/ASDKgram/Sample/CommentFeedModel.h b/examples/ASDKgram/Sample/CommentFeedModel.h index 87504b5a..adfd4206 100644 --- a/examples/ASDKgram/Sample/CommentFeedModel.h +++ b/examples/ASDKgram/Sample/CommentFeedModel.h @@ -6,7 +6,6 @@ // Copyright © 2016 Hannah Troisi. All rights reserved. // -#import #import "CommentModel.h" @interface CommentFeedModel : NSObject diff --git a/examples/ASDKgram/Sample/CommentFeedModel.m b/examples/ASDKgram/Sample/CommentFeedModel.m index 4ceca4a9..257154f6 100644 --- a/examples/ASDKgram/Sample/CommentFeedModel.m +++ b/examples/ASDKgram/Sample/CommentFeedModel.m @@ -7,9 +7,10 @@ // #import "CommentFeedModel.h" -#import #import "Utilities.h" +#define NUM_COMMENTS_TO_SHOW 3 + #define fiveHundredPX_ENDPOINT_HOST @"https://api.500px.com/v1/" #define fiveHundredPX_ENDPOINT_COMMENTS @"photos/4928401/comments" #define fiveHundredPX_ENDPOINT_SEARCH @"photos/search?geo=" //latitude,longitude,radius @@ -157,8 +158,8 @@ if ([comments isKindOfClass:[NSArray class]]) { NSUInteger numComments = [comments count]; - if (numComments > 3) { - comments = [comments subarrayWithRange:(NSRange){numComments-3, 3}]; + if (numComments > NUM_COMMENTS_TO_SHOW) { + comments = [comments subarrayWithRange:(NSRange){numComments-NUM_COMMENTS_TO_SHOW, NUM_COMMENTS_TO_SHOW}]; } for (NSDictionary *commentDictionary in comments) { diff --git a/examples/ASDKgram/Sample/CommentModel.h b/examples/ASDKgram/Sample/CommentModel.h index e584aed7..f102cfb0 100644 --- a/examples/ASDKgram/Sample/CommentModel.h +++ b/examples/ASDKgram/Sample/CommentModel.h @@ -6,9 +6,6 @@ // Copyright © 2016 Hannah Troisi. All rights reserved. // -#import -#import - @interface CommentModel : NSObject @property (nonatomic, assign, readonly) NSUInteger ID; diff --git a/examples/ASDKgram/Sample/CommentView.h b/examples/ASDKgram/Sample/CommentView.h index 8aa02163..c17b2a40 100644 --- a/examples/ASDKgram/Sample/CommentView.h +++ b/examples/ASDKgram/Sample/CommentView.h @@ -6,7 +6,6 @@ // Copyright © 2016 Hannah Troisi. All rights reserved. // -#import #import "CommentFeedModel.h" @interface CommentView : UIView diff --git a/examples/ASDKgram/Sample/ImageURLModel.h b/examples/ASDKgram/Sample/ImageURLModel.h index b39367df..a0a82966 100644 --- a/examples/ASDKgram/Sample/ImageURLModel.h +++ b/examples/ASDKgram/Sample/ImageURLModel.h @@ -6,9 +6,6 @@ // Copyright © 2016 Hannah Troisi. All rights reserved. // -#import -#import - @interface ImageURLModel : NSObject + (NSString *)imageParameterForClosestImageSize:(CGSize)size; diff --git a/examples/ASDKgram/Sample/Info.plist b/examples/ASDKgram/Sample/Info.plist index cb3756a0..74faa7f5 100644 --- a/examples/ASDKgram/Sample/Info.plist +++ b/examples/ASDKgram/Sample/Info.plist @@ -2,6 +2,8 @@ + UIViewControllerBasedStatusBarAppearance + CFBundleDevelopmentRegion en CFBundleExecutable diff --git a/examples/ASDKgram/Sample/LocationModel.h b/examples/ASDKgram/Sample/LocationModel.h index c8727a88..cdc7cbd7 100644 --- a/examples/ASDKgram/Sample/LocationModel.h +++ b/examples/ASDKgram/Sample/LocationModel.h @@ -6,7 +6,6 @@ // Copyright © 2016 Hannah Troisi. All rights reserved. // -#import #import "CoreLocation/CoreLocation.h" @interface LocationModel : NSObject diff --git a/examples/ASDKgram/Sample/LocationModel.m b/examples/ASDKgram/Sample/LocationModel.m index 773bff98..ed1fc284 100644 --- a/examples/ASDKgram/Sample/LocationModel.m +++ b/examples/ASDKgram/Sample/LocationModel.m @@ -7,7 +7,6 @@ // #import "LocationModel.h" -#import #import @implementation LocationModel diff --git a/examples/ASDKgram/Sample/PhotoCellNode.h b/examples/ASDKgram/Sample/PhotoCellNode.h index 31845e51..3f241032 100644 --- a/examples/ASDKgram/Sample/PhotoCellNode.h +++ b/examples/ASDKgram/Sample/PhotoCellNode.h @@ -6,7 +6,6 @@ // Copyright © 2016 Hannah Troisi. All rights reserved. // -#import #import #import "PhotoModel.h" #import diff --git a/examples/ASDKgram/Sample/PhotoCollectionViewCell.h b/examples/ASDKgram/Sample/PhotoCollectionViewCell.h index c043f783..2a3d5268 100644 --- a/examples/ASDKgram/Sample/PhotoCollectionViewCell.h +++ b/examples/ASDKgram/Sample/PhotoCollectionViewCell.h @@ -6,7 +6,6 @@ // Copyright © 2016 Hannah Troisi. All rights reserved. // -#import #import "PhotoModel.h" @interface PhotoCollectionViewCell : UICollectionViewCell diff --git a/examples/ASDKgram/Sample/PhotoFeedModel.h b/examples/ASDKgram/Sample/PhotoFeedModel.h index acc8c34b..f2bb4bbb 100644 --- a/examples/ASDKgram/Sample/PhotoFeedModel.h +++ b/examples/ASDKgram/Sample/PhotoFeedModel.h @@ -6,7 +6,6 @@ // Copyright © 2016 Hannah Troisi. All rights reserved. // -#import #import "PhotoModel.h" typedef NS_ENUM(NSInteger, PhotoFeedModelType) { diff --git a/examples/ASDKgram/Sample/PhotoFeedNodeController.h b/examples/ASDKgram/Sample/PhotoFeedNodeController.h index 00b13c36..a0e72c1a 100644 --- a/examples/ASDKgram/Sample/PhotoFeedNodeController.h +++ b/examples/ASDKgram/Sample/PhotoFeedNodeController.h @@ -9,6 +9,6 @@ #import #import "AppDelegate.h" -@interface PhotoFeedNodeController : ASViewController +@interface PhotoFeedNodeController : ASViewController @end diff --git a/examples/ASDKgram/Sample/PhotoFeedNodeController.m b/examples/ASDKgram/Sample/PhotoFeedNodeController.m index 8ccf289f..e512db8a 100644 --- a/examples/ASDKgram/Sample/PhotoFeedNodeController.m +++ b/examples/ASDKgram/Sample/PhotoFeedNodeController.m @@ -22,7 +22,6 @@ { PhotoFeedModel *_photoFeed; ASTableNode *_tableNode; - UIView *_statusBarOpaqueUnderlayView; } #pragma mark - Lifecycle diff --git a/examples/ASDKgram/Sample/PhotoFeedViewController.h b/examples/ASDKgram/Sample/PhotoFeedViewController.h index 87ec1686..053812ed 100644 --- a/examples/ASDKgram/Sample/PhotoFeedViewController.h +++ b/examples/ASDKgram/Sample/PhotoFeedViewController.h @@ -6,9 +6,8 @@ // Copyright © 2016 Hannah Troisi. All rights reserved. // -#import #import "AppDelegate.h" -@interface PhotoFeedViewController : UIViewController +@interface PhotoFeedViewController : UIViewController @end diff --git a/examples/ASDKgram/Sample/PhotoFeedViewController.m b/examples/ASDKgram/Sample/PhotoFeedViewController.m index d75c5ba4..c9e55812 100644 --- a/examples/ASDKgram/Sample/PhotoFeedViewController.m +++ b/examples/ASDKgram/Sample/PhotoFeedViewController.m @@ -21,7 +21,6 @@ { PhotoFeedModel *_photoFeed; UITableView *_tableView; - UIView *_statusBarOpaqueUnderlayView; } #pragma mark - Lifecycle diff --git a/examples/ASDKgram/Sample/PhotoModel.h b/examples/ASDKgram/Sample/PhotoModel.h index 97e6a5c6..d89c688f 100644 --- a/examples/ASDKgram/Sample/PhotoModel.h +++ b/examples/ASDKgram/Sample/PhotoModel.h @@ -6,7 +6,6 @@ // Copyright © 2016 Hannah Troisi. All rights reserved. // -#import #import "CoreGraphics/CoreGraphics.h" #import "UserModel.h" #import "LocationModel.h" diff --git a/examples/ASDKgram/Sample/PhotoModel.m b/examples/ASDKgram/Sample/PhotoModel.m index e92737a2..b05005c5 100644 --- a/examples/ASDKgram/Sample/PhotoModel.m +++ b/examples/ASDKgram/Sample/PhotoModel.m @@ -7,10 +7,8 @@ // #import "PhotoModel.h" -#import #import "Utilities.h" - @implementation PhotoModel { NSDictionary *_dictionaryRepresentation; diff --git a/examples/ASDKgram/Sample/PhotoTableViewCell.h b/examples/ASDKgram/Sample/PhotoTableViewCell.h index 21caabb1..c464f996 100644 --- a/examples/ASDKgram/Sample/PhotoTableViewCell.h +++ b/examples/ASDKgram/Sample/PhotoTableViewCell.h @@ -6,7 +6,6 @@ // Copyright © 2016 Hannah Troisi. All rights reserved. // -#import #import #import "PhotoModel.h" diff --git a/examples/ASDKgram/Sample/Flickrgram.pch b/examples/ASDKgram/Sample/Sample.pch similarity index 51% rename from examples/ASDKgram/Sample/Flickrgram.pch rename to examples/ASDKgram/Sample/Sample.pch index 5005dea6..8c35575c 100644 --- a/examples/ASDKgram/Sample/Flickrgram.pch +++ b/examples/ASDKgram/Sample/Sample.pch @@ -10,8 +10,6 @@ #define Flickrgram_pch #import - -// Include any system framework and library headers here that should be included in all compilation units. -// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. +#import #endif /* Flickrgram_pch */ diff --git a/examples/ASDKgram/Sample/UserModel.h b/examples/ASDKgram/Sample/UserModel.h index 7c41dd83..9595ce04 100644 --- a/examples/ASDKgram/Sample/UserModel.h +++ b/examples/ASDKgram/Sample/UserModel.h @@ -6,9 +6,6 @@ // Copyright © 2016 Hannah Troisi. All rights reserved. // -#import -#import - @interface UserModel : NSObject @property (nonatomic, assign, readonly) NSDictionary *dictionaryRepresentation; diff --git a/examples/ASDKgram/Sample/UserModel.m b/examples/ASDKgram/Sample/UserModel.m index 7a7edc30..01c5acb7 100644 --- a/examples/ASDKgram/Sample/UserModel.m +++ b/examples/ASDKgram/Sample/UserModel.m @@ -7,7 +7,6 @@ // #import "UserModel.h" -#import #import "Utilities.h" @implementation UserModel diff --git a/examples/ASDKgram/Sample/Utilities.h b/examples/ASDKgram/Sample/Utilities.h index af8e1f12..cd05b36d 100644 --- a/examples/ASDKgram/Sample/Utilities.h +++ b/examples/ASDKgram/Sample/Utilities.h @@ -6,9 +6,6 @@ // Copyright © 2016 Hannah Troisi. All rights reserved. // -#import -#import - @interface UIColor (Additions) + (UIColor *)darkBlueColor; diff --git a/examples/ASDKgram/Sample/Utilities.m b/examples/ASDKgram/Sample/Utilities.m index 590376dc..93574aa1 100644 --- a/examples/ASDKgram/Sample/Utilities.m +++ b/examples/ASDKgram/Sample/Utilities.m @@ -7,7 +7,6 @@ // #import "Utilities.h" -#import #define StrokeRoundedImages 0 diff --git a/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.h b/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.h new file mode 100644 index 00000000..d822c78c --- /dev/null +++ b/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.h @@ -0,0 +1,11 @@ +// +// WindowWithStatusBarUnderlay.h +// Sample +// +// Created by Hannah Troisi on 4/10/16. +// Copyright © 2016 Facebook. All rights reserved. +// + +@interface WindowWithStatusBarUnderlay : UIWindow + +@end diff --git a/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.m b/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.m new file mode 100644 index 00000000..a521cfa5 --- /dev/null +++ b/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.m @@ -0,0 +1,40 @@ +// +// WindowWithStatusBarUnderlay.m +// Sample +// +// Created by Hannah Troisi on 4/10/16. +// Copyright © 2016 Facebook. All rights reserved. +// + +#import "WindowWithStatusBarUnderlay.h" +#import "Utilities.h" + +@implementation WindowWithStatusBarUnderlay +{ + UIView *_statusBarOpaqueUnderlayView; +} + +-(instancetype)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + _statusBarOpaqueUnderlayView = [[UIView alloc] init]; + _statusBarOpaqueUnderlayView.backgroundColor = [UIColor darkBlueColor]; + [self addSubview:_statusBarOpaqueUnderlayView]; + } + return self; +} + +-(void)layoutSubviews +{ + [super layoutSubviews]; + + [self bringSubviewToFront:_statusBarOpaqueUnderlayView]; + + _statusBarOpaqueUnderlayView.frame = CGRectMake(0, + 0, + [[UIScreen mainScreen] bounds].size.width, + [[UIApplication sharedApplication] statusBarFrame].size.height); +} + +@end diff --git a/examples/ASDKgram/Sample/main.m b/examples/ASDKgram/Sample/main.m index ddf492b6..9162b66d 100644 --- a/examples/ASDKgram/Sample/main.m +++ b/examples/ASDKgram/Sample/main.m @@ -11,7 +11,6 @@ // Copyright © 2016 Hannah Troisi. All rights reserved. // -#import #import "AppDelegate.h" int main(int argc, char * argv[]) {