Skip to content

Instantly share code, notes, and snippets.

@Shilo
Created April 14, 2014 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shilo/10634206 to your computer and use it in GitHub Desktop.
Save Shilo/10634206 to your computer and use it in GitHub Desktop.
Objective-C code to run a blank app delegate on Test.
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
#import "TestAppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool
{
BOOL runningTests = (NSClassFromString(@"XCTestCase") != nil);
return UIApplicationMain(argc, argv, nil, NSStringFromClass((!runningTests?[AppDelegate class]:[TestAppDelegate class])));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment