diff --git a/Example/AppTestDelegate.h b/Example/AppTestDelegate.h new file mode 100644 index 00000000..004a6a53 --- /dev/null +++ b/Example/AppTestDelegate.h @@ -0,0 +1,15 @@ +// +// AppTestDelegate.h +// Espressos +// +// Created by Jonathan Hersh on 6/15/15. +// Copyright (c) 2015 Gowalla. All rights reserved. +// + +#import + +@interface AppTestDelegate : UIResponder + +@property (nonatomic, strong) UIWindow *window; + +@end diff --git a/Example/AppTestDelegate.m b/Example/AppTestDelegate.m new file mode 100644 index 00000000..64f309c1 --- /dev/null +++ b/Example/AppTestDelegate.m @@ -0,0 +1,22 @@ +// +// AppTestDelegate.m +// Espressos +// +// Created by Jonathan Hersh on 6/15/15. +// +// + +#import "AppTestDelegate.h" + +@implementation AppTestDelegate + +- (BOOL)application:(__unused UIApplication *)application didFinishLaunchingWithOptions:(__unused NSDictionary *)launchOptions { + _window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; + self.window.rootViewController = [UIViewController new]; + self.window.backgroundColor = [UIColor whiteColor]; + [self.window makeKeyAndVisible]; + + return YES; +} + +@end diff --git a/Example/Espressos.xcodeproj/project.pbxproj b/Example/Espressos.xcodeproj/project.pbxproj index b308e698..e12f5dd1 100644 --- a/Example/Espressos.xcodeproj/project.pbxproj +++ b/Example/Espressos.xcodeproj/project.pbxproj @@ -9,6 +9,7 @@ /* Begin PBXBuildFile section */ B6EDD905BC31B7CDBC772A6E /* libPods-Espressos.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E5AA1C6D161D3700C394B3E8 /* libPods-Espressos.a */; }; CBB8BA972A3E9E100E5BEC20 /* libPods-TTTAttributedLabelTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F5661A15C6EB332A5F384694 /* libPods-TTTAttributedLabelTests.a */; }; + E957D6671B2F9A1800090F1E /* AppTestDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E957D6661B2F9A1800090F1E /* AppTestDelegate.m */; }; E9B3C6EC1A32C2DB00D43DF9 /* TTTAttributedLabelTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E9B3C6EB1A32C2DB00D43DF9 /* TTTAttributedLabelTests.m */; }; E9B3C6F61A32C5B100D43DF9 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E9B3C6F51A32C5B100D43DF9 /* Images.xcassets */; }; F83BDEAA18A5C2DF003893B2 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F83BDEA918A5C2DF003893B2 /* QuartzCore.framework */; }; @@ -42,6 +43,8 @@ ABD98C20CBB3ED458920107F /* Pods-Espressos.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Espressos.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Espressos/Pods-Espressos.debug.xcconfig"; sourceTree = ""; }; D21F16D2D49068B84D92B071 /* Pods-TTTAttributedLabelTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TTTAttributedLabelTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TTTAttributedLabelTests/Pods-TTTAttributedLabelTests.debug.xcconfig"; sourceTree = ""; }; E5AA1C6D161D3700C394B3E8 /* libPods-Espressos.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Espressos.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + E957D6651B2F9A1800090F1E /* AppTestDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppTestDelegate.h; sourceTree = SOURCE_ROOT; }; + E957D6661B2F9A1800090F1E /* AppTestDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppTestDelegate.m; sourceTree = SOURCE_ROOT; }; E9B3C6E71A32C2DB00D43DF9 /* TTTAttributedLabelTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TTTAttributedLabelTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; E9B3C6EA1A32C2DB00D43DF9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; E9B3C6EB1A32C2DB00D43DF9 /* TTTAttributedLabelTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TTTAttributedLabelTests.m; sourceTree = ""; }; @@ -162,6 +165,8 @@ children = ( F8C05AA1165716EF00B0ACDD /* AppDelegate.h */, F8C05AA2165716EF00B0ACDD /* AppDelegate.m */, + E957D6651B2F9A1800090F1E /* AppTestDelegate.h */, + E957D6661B2F9A1800090F1E /* AppTestDelegate.m */, F877A39013782E870022A8AB /* Controllers */, F877A39113782E9C0022A8AB /* Views */, F877A36713782AF10022A8AB /* Supporting Files */, @@ -373,6 +378,7 @@ files = ( F8C05AA4165716EF00B0ACDD /* AppDelegate.m in Sources */, F8C05AA5165716EF00B0ACDD /* main.m in Sources */, + E957D6671B2F9A1800090F1E /* AppTestDelegate.m in Sources */, F8C05AA81657170A00B0ACDD /* AttributedTableViewCell.m in Sources */, F8C05AAD1657171400B0ACDD /* DetailViewController.m in Sources */, F8C05AAE1657171400B0ACDD /* RootViewController.m in Sources */, diff --git a/Example/main.m b/Example/main.m index 7f7b8170..7a0480e9 100644 --- a/Example/main.m +++ b/Example/main.m @@ -21,10 +21,15 @@ // THE SOFTWARE. #import +#import "AppDelegate.h" +#import "AppTestDelegate.h" int main(int argc, char *argv[]) { @autoreleasepool { - int retVal = UIApplicationMain(argc, argv, @"UIApplication", @"AppDelegate"); - return retVal; + Class appDelegateClass = (NSClassFromString(@"XCTestCase") != nil + ? [AppTestDelegate class] + : [AppDelegate class]); + + return UIApplicationMain(argc, argv, @"UIApplication", NSStringFromClass(appDelegateClass)); } }